| 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/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/i18n/time_formatting.h" | 13 #include "base/i18n/time_formatting.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
| 16 #include "base/time.h" | 16 #include "base/time.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "chrome/browser/chromeos/cros/cros_library.h" | 19 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 20 #include "chrome/browser/chromeos/cros/power_library.h" | |
| 21 #include "chrome/browser/chromeos/cros/update_library.h" | 20 #include "chrome/browser/chromeos/cros/update_library.h" |
| 21 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 22 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
| 22 #include "chrome/browser/chromeos/login/user_manager.h" | 23 #include "chrome/browser/chromeos/login/user_manager.h" |
| 23 #include "chrome/browser/chromeos/login/wizard_controller.h" | 24 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 24 #include "chrome/browser/chromeos/user_cros_settings_provider.h" | 25 #include "chrome/browser/chromeos/user_cros_settings_provider.h" |
| 25 #include "chrome/browser/google/google_util.h" | 26 #include "chrome/browser/google/google_util.h" |
| 26 #include "chrome/common/chrome_version_info.h" | 27 #include "chrome/common/chrome_version_info.h" |
| 27 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 28 #include "content/public/common/content_client.h" | 29 #include "content/public/common/content_client.h" |
| 29 #include "googleurl/src/gurl.h" | 30 #include "googleurl/src/gurl.h" |
| 30 #include "grit/chromium_strings.h" | 31 #include "grit/chromium_strings.h" |
| 31 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 if (CrosLibrary::Get()->EnsureLoaded() && | 293 if (CrosLibrary::Get()->EnsureLoaded() && |
| 293 (!WizardController::default_controller() || | 294 (!WizardController::default_controller() || |
| 294 WizardController::IsDeviceRegistered())) { | 295 WizardController::IsDeviceRegistered())) { |
| 295 CrosLibrary::Get()->GetUpdateLibrary()-> | 296 CrosLibrary::Get()->GetUpdateLibrary()-> |
| 296 RequestUpdateCheck(NULL, // no callback | 297 RequestUpdateCheck(NULL, // no callback |
| 297 NULL); // no userdata | 298 NULL); // no userdata |
| 298 } | 299 } |
| 299 } | 300 } |
| 300 | 301 |
| 301 void AboutPageHandler::RestartNow(const ListValue* args) { | 302 void AboutPageHandler::RestartNow(const ListValue* args) { |
| 302 CrosLibrary::Get()->GetPowerLibrary()->RequestRestart(); | 303 DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); |
| 303 } | 304 } |
| 304 | 305 |
| 305 void AboutPageHandler::UpdateStatus( | 306 void AboutPageHandler::UpdateStatus( |
| 306 const UpdateLibrary::Status& status) { | 307 const UpdateLibrary::Status& status) { |
| 307 string16 message; | 308 string16 message; |
| 308 std::string image = "up-to-date"; | 309 std::string image = "up-to-date"; |
| 309 bool enabled = false; | 310 bool enabled = false; |
| 310 | 311 |
| 311 switch (status.status) { | 312 switch (status.status) { |
| 312 case UPDATE_STATUS_IDLE: | 313 case UPDATE_STATUS_IDLE: |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { | 417 if (CrosLibrary::Get()->GetUpdateLibrary()->HasObserver(observer)) { |
| 417 // If UpdateLibrary still has the observer, then the page handler is valid. | 418 // If UpdateLibrary still has the observer, then the page handler is valid. |
| 418 AboutPageHandler* handler = observer->page_handler(); | 419 AboutPageHandler* handler = observer->page_handler(); |
| 419 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); | 420 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); |
| 420 handler->web_ui_->CallJavascriptFunction( | 421 handler->web_ui_->CallJavascriptFunction( |
| 421 "AboutPage.updateSelectedOptionCallback", *channel_string); | 422 "AboutPage.updateSelectedOptionCallback", *channel_string); |
| 422 } | 423 } |
| 423 } | 424 } |
| 424 | 425 |
| 425 } // namespace chromeos | 426 } // namespace chromeos |
| OLD | NEW |