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/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/callback.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 NewCallback(this, &AboutPageHandler::SetReleaseTrack)); | 239 NewCallback(this, &AboutPageHandler::SetReleaseTrack)); |
240 | 240 |
241 web_ui_->RegisterMessageCallback("CheckNow", | 241 web_ui_->RegisterMessageCallback("CheckNow", |
242 NewCallback(this, &AboutPageHandler::CheckNow)); | 242 NewCallback(this, &AboutPageHandler::CheckNow)); |
243 web_ui_->RegisterMessageCallback("RestartNow", | 243 web_ui_->RegisterMessageCallback("RestartNow", |
244 NewCallback(this, &AboutPageHandler::RestartNow)); | 244 NewCallback(this, &AboutPageHandler::RestartNow)); |
245 } | 245 } |
246 | 246 |
247 void AboutPageHandler::PageReady(const ListValue* args) { | 247 void AboutPageHandler::PageReady(const ListValue* args) { |
248 // Version information is loaded from a callback | 248 // Version information is loaded from a callback |
249 loader_.EnablePlatformVersions(true); | |
250 loader_.GetVersion(&consumer_, | 249 loader_.GetVersion(&consumer_, |
251 NewCallback(this, &AboutPageHandler::OnOSVersion), | 250 NewCallback(this, &AboutPageHandler::OnOSVersion), |
252 VersionLoader::VERSION_FULL); | 251 VersionLoader::VERSION_FULL); |
253 loader_.GetFirmware(&consumer_, | 252 loader_.GetFirmware(&consumer_, |
254 NewCallback(this, &AboutPageHandler::OnOSFirmware)); | 253 NewCallback(this, &AboutPageHandler::OnOSFirmware)); |
255 | 254 |
256 UpdateLibrary* update_library = | 255 UpdateLibrary* update_library = |
257 CrosLibrary::Get()->GetUpdateLibrary(); | 256 CrosLibrary::Get()->GetUpdateLibrary(); |
258 | 257 |
259 update_observer_.reset(new UpdateObserver(this)); | 258 update_observer_.reset(new UpdateObserver(this)); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { | 411 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { |
413 // If UpdateLibrary still has the observer, then the page handler is valid. | 412 // If UpdateLibrary still has the observer, then the page handler is valid. |
414 AboutPageHandler* handler = observer->page_handler(); | 413 AboutPageHandler* handler = observer->page_handler(); |
415 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); | 414 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); |
416 handler->web_ui_->CallJavascriptFunction( | 415 handler->web_ui_->CallJavascriptFunction( |
417 "AboutPage.updateSelectedOptionCallback", *channel_string); | 416 "AboutPage.updateSelectedOptionCallback", *channel_string); |
418 } | 417 } |
419 } | 418 } |
420 | 419 |
421 } // namespace chromeos | 420 } // namespace chromeos |
OLD | NEW |