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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/about_page_handler.cc

Issue 8113025: base::Bind: More converts, mostly in WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options/chromeos/about_page_handler.h" 5 #include "chrome/browser/ui/webui/options/chromeos/about_page_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/callback.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h"
11 #include "base/command_line.h" 12 #include "base/command_line.h"
12 #include "base/i18n/time_formatting.h" 13 #include "base/i18n/time_formatting.h"
13 #include "base/string16.h" 14 #include "base/string16.h"
14 #include "base/string_number_conversions.h" 15 #include "base/string_number_conversions.h"
15 #include "base/time.h" 16 #include "base/time.h"
16 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
17 #include "base/values.h" 18 #include "base/values.h"
18 #include "chrome/browser/chromeos/cros/cros_library.h" 19 #include "chrome/browser/chromeos/cros/cros_library.h"
19 #include "chrome/browser/chromeos/cros/power_library.h" 20 #include "chrome/browser/chromeos/cros/power_library.h"
20 #include "chrome/browser/chromeos/cros/update_library.h" 21 #include "chrome/browser/chromeos/cros/update_library.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 241
241 web_ui_->RegisterMessageCallback("CheckNow", 242 web_ui_->RegisterMessageCallback("CheckNow",
242 NewCallback(this, &AboutPageHandler::CheckNow)); 243 NewCallback(this, &AboutPageHandler::CheckNow));
243 web_ui_->RegisterMessageCallback("RestartNow", 244 web_ui_->RegisterMessageCallback("RestartNow",
244 NewCallback(this, &AboutPageHandler::RestartNow)); 245 NewCallback(this, &AboutPageHandler::RestartNow));
245 } 246 }
246 247
247 void AboutPageHandler::PageReady(const ListValue* args) { 248 void AboutPageHandler::PageReady(const ListValue* args) {
248 // Version information is loaded from a callback 249 // Version information is loaded from a callback
249 loader_.GetVersion(&consumer_, 250 loader_.GetVersion(&consumer_,
250 NewCallback(this, &AboutPageHandler::OnOSVersion), 251 base::Bind(&AboutPageHandler::OnOSVersion,
252 base::Unretained(this)),
251 VersionLoader::VERSION_FULL); 253 VersionLoader::VERSION_FULL);
252 loader_.GetFirmware(&consumer_, 254 loader_.GetFirmware(&consumer_,
253 NewCallback(this, &AboutPageHandler::OnOSFirmware)); 255 base::Bind(&AboutPageHandler::OnOSFirmware,
256 base::Unretained(this)));
254 257
255 UpdateLibrary* update_library = 258 UpdateLibrary* update_library =
256 CrosLibrary::Get()->GetUpdateLibrary(); 259 CrosLibrary::Get()->GetUpdateLibrary();
257 260
258 update_observer_.reset(new UpdateObserver(this)); 261 update_observer_.reset(new UpdateObserver(this));
259 update_library->AddObserver(update_observer_.get()); 262 update_library->AddObserver(update_observer_.get());
260 263
261 // Update the WebUI page with the current status. See comments below. 264 // Update the WebUI page with the current status. See comments below.
262 UpdateStatus(update_library->status()); 265 UpdateStatus(update_library->status());
263 266
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { 414 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) {
412 // If UpdateLibrary still has the observer, then the page handler is valid. 415 // If UpdateLibrary still has the observer, then the page handler is valid.
413 AboutPageHandler* handler = observer->page_handler(); 416 AboutPageHandler* handler = observer->page_handler();
414 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); 417 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel));
415 handler->web_ui_->CallJavascriptFunction( 418 handler->web_ui_->CallJavascriptFunction(
416 "AboutPage.updateSelectedOptionCallback", *channel_string); 419 "AboutPage.updateSelectedOptionCallback", *channel_string);
417 } 420 }
418 } 421 }
419 422
420 } // namespace chromeos 423 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698