| OLD | NEW |
| 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/about_page_handler.h" | 5 #include "chrome/browser/ui/webui/options/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/callback.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 web_ui_->RegisterMessageCallback("CheckNow", | 266 web_ui_->RegisterMessageCallback("CheckNow", |
| 267 NewCallback(this, &AboutPageHandler::CheckNow)); | 267 NewCallback(this, &AboutPageHandler::CheckNow)); |
| 268 web_ui_->RegisterMessageCallback("RestartNow", | 268 web_ui_->RegisterMessageCallback("RestartNow", |
| 269 NewCallback(this, &AboutPageHandler::RestartNow)); | 269 NewCallback(this, &AboutPageHandler::RestartNow)); |
| 270 #endif | 270 #endif |
| 271 } | 271 } |
| 272 | 272 |
| 273 void AboutPageHandler::PageReady(const ListValue* args) { | 273 void AboutPageHandler::PageReady(const ListValue* args) { |
| 274 #if defined(OS_CHROMEOS) | 274 #if defined(OS_CHROMEOS) |
| 275 // Version information is loaded from a callback | 275 // Version information is loaded from a callback |
| 276 loader_.EnablePlatformVersions(true); |
| 276 loader_.GetVersion(&consumer_, | 277 loader_.GetVersion(&consumer_, |
| 277 NewCallback(this, &AboutPageHandler::OnOSVersion), | 278 NewCallback(this, &AboutPageHandler::OnOSVersion), |
| 278 chromeos::VersionLoader::VERSION_FULL); | 279 chromeos::VersionLoader::VERSION_FULL); |
| 279 loader_.GetFirmware(&consumer_, | 280 loader_.GetFirmware(&consumer_, |
| 280 NewCallback(this, &AboutPageHandler::OnOSFirmware)); | 281 NewCallback(this, &AboutPageHandler::OnOSFirmware)); |
| 281 | 282 |
| 282 chromeos::UpdateLibrary* update_library = | 283 chromeos::UpdateLibrary* update_library = |
| 283 chromeos::CrosLibrary::Get()->GetUpdateLibrary(); | 284 chromeos::CrosLibrary::Get()->GetUpdateLibrary(); |
| 284 | 285 |
| 285 update_observer_.reset(new UpdateObserver(this)); | 286 update_observer_.reset(new UpdateObserver(this)); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 if (chromeos::CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { | 444 if (chromeos::CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { |
| 444 // If UpdateLibrary still has the observer, then the page handler is valid. | 445 // If UpdateLibrary still has the observer, then the page handler is valid. |
| 445 AboutPageHandler* handler = observer->page_handler(); | 446 AboutPageHandler* handler = observer->page_handler(); |
| 446 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); | 447 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); |
| 447 handler->web_ui_->CallJavascriptFunction( | 448 handler->web_ui_->CallJavascriptFunction( |
| 448 "AboutPage.updateSelectedOptionCallback", *channel_string); | 449 "AboutPage.updateSelectedOptionCallback", *channel_string); |
| 449 } | 450 } |
| 450 } | 451 } |
| 451 | 452 |
| 452 #endif // defined(OS_CHROMEOS) | 453 #endif // defined(OS_CHROMEOS) |
| OLD | NEW |