• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
VersionHandlerChromeOS()10 VersionHandlerChromeOS::VersionHandlerChromeOS() {
11 }
12 
~VersionHandlerChromeOS()13 VersionHandlerChromeOS::~VersionHandlerChromeOS() {
14 }
15 
HandleRequestVersionInfo(const base::ListValue * args)16 void VersionHandlerChromeOS::HandleRequestVersionInfo(
17     const base::ListValue* args) {
18   // Start the asynchronous load of the version.
19   loader_.GetVersion(
20       chromeos::VersionLoader::VERSION_FULL,
21       base::Bind(&VersionHandlerChromeOS::OnVersion, base::Unretained(this)),
22       &tracker_);
23 
24   // Parent class takes care of the rest.
25   VersionHandler::HandleRequestVersionInfo(args);
26 }
27 
OnVersion(const std::string & version)28 void VersionHandlerChromeOS::OnVersion(const std::string& version) {
29   base::StringValue arg(version);
30   web_ui()->CallJavascriptFunction("returnOsVersion", arg);
31 }
32