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