Home | History | Annotate | Download | only in webui
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/ui/webui/version_handler_chromeos.h"
      6 
      7 #include "base/bind.h"
      8 #include "content/public/browser/web_ui.h"
      9 
     10 VersionHandlerChromeOS::VersionHandlerChromeOS() {
     11 }
     12 
     13 VersionHandlerChromeOS::~VersionHandlerChromeOS() {
     14 }
     15 
     16 void VersionHandlerChromeOS::HandleRequestVersionInfo(const ListValue* args) {
     17   // Start the asynchronous load of the version.
     18   loader_.GetVersion(
     19       chromeos::VersionLoader::VERSION_FULL,
     20       base::Bind(&VersionHandlerChromeOS::OnVersion, base::Unretained(this)),
     21       &tracker_);
     22 
     23   // Parent class takes care of the rest.
     24   VersionHandler::HandleRequestVersionInfo(args);
     25 }
     26 
     27 void VersionHandlerChromeOS::OnVersion(const std::string& version) {
     28   StringValue arg(version);
     29   web_ui()->CallJavascriptFunction("returnOsVersion", arg);
     30 }
     31