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.
5 #include "chrome/browser/ui/webui/version_handler_chromeos.h"
8 #include "content/public/browser/web_ui.h"
10 VersionHandlerChromeOS::VersionHandlerChromeOS() {
13 VersionHandlerChromeOS::~VersionHandlerChromeOS() {
16 void VersionHandlerChromeOS::HandleRequestVersionInfo(const ListValue* args) {
17 // Start the asynchronous load of the version.
19 chromeos::VersionLoader::VERSION_FULL,
20 base::Bind(&VersionHandlerChromeOS::OnVersion, base::Unretained(this)),
23 // Parent class takes care of the rest.
24 VersionHandler::HandleRequestVersionInfo(args);
27 void VersionHandlerChromeOS::OnVersion(const std::string& version) {
28 StringValue arg(version);
29 web_ui()->CallJavascriptFunction("returnOsVersion", arg);