Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: chrome/browser/ui/webui/version_handler_chromeos.cc

Issue 1486403002: Mojo-ifying chrome://version. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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 "base/task_runner_util.h"
9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/web_ui.h"
11
12 VersionHandlerChromeOS::VersionHandlerChromeOS()
13 : weak_factory_(this) {
14 }
15
16 VersionHandlerChromeOS::~VersionHandlerChromeOS() {
17 }
18
19 void VersionHandlerChromeOS::HandleRequestVersionInfo(
20 const base::ListValue* args) {
21 // Start the asynchronous load of the version.
22 base::PostTaskAndReplyWithResult(
23 content::BrowserThread::GetBlockingPool(),
24 FROM_HERE,
25 base::Bind(&chromeos::version_loader::GetVersion,
26 chromeos::version_loader::VERSION_FULL),
27 base::Bind(&VersionHandlerChromeOS::OnVersion,
28 weak_factory_.GetWeakPtr()));
29
30 // Parent class takes care of the rest.
31 VersionHandler::HandleRequestVersionInfo(args);
32 }
33
34 void VersionHandlerChromeOS::OnVersion(const std::string& version) {
35 base::StringValue arg(version);
36 web_ui()->CallJavascriptFunction("returnOsVersion", arg);
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698