Chromium Code Reviews| 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/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/browser/automation/automation_provider_json.h" | 12 #include "chrome/browser/automation/automation_provider_json.h" |
| 13 #include "chrome/browser/automation/automation_provider_observers.h" | 13 #include "chrome/browser/automation/automation_provider_observers.h" |
| 14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/chromeos/audio_handler.h" | 15 #include "chrome/browser/chromeos/audio_handler.h" |
| 16 #include "chrome/browser/chromeos/cros/cros_library.h" | 16 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 17 #include "chrome/browser/chromeos/cros/network_library.h" | 17 #include "chrome/browser/chromeos/cros/network_library.h" |
| 18 #include "chrome/browser/chromeos/cros/power_library.h" | 18 #include "chrome/browser/chromeos/cros/power_library.h" |
| 19 #include "chrome/browser/chromeos/cros/screen_lock_library.h" | |
| 20 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 19 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
|
satorux1
2011/11/29 01:29:12
Shouldn't we include power_manager_client.h?
Simon Que
2011/11/29 01:47:32
Done.
| |
| 21 #include "chrome/browser/chromeos/dbus/update_engine_client.h" | 20 #include "chrome/browser/chromeos/dbus/update_engine_client.h" |
| 22 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen. h" | 21 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen. h" |
| 23 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 22 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 24 #include "chrome/browser/chromeos/login/login_display.h" | 23 #include "chrome/browser/chromeos/login/login_display.h" |
| 25 #include "chrome/browser/chromeos/login/login_display_host.h" | 24 #include "chrome/browser/chromeos/login/login_display_host.h" |
| 26 #include "chrome/browser/chromeos/login/screen_locker.h" | 25 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 27 #include "chrome/browser/chromeos/login/webui_login_display.h" | 26 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 28 #include "chrome/browser/chromeos/login/wizard_controller.h" | 27 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 29 #include "chrome/browser/chromeos/options/take_photo_dialog.h" | 28 #include "chrome/browser/chromeos/options/take_photo_dialog.h" |
| 30 #include "chrome/browser/chromeos/proxy_cros_settings_parser.h" | 29 #include "chrome/browser/chromeos/proxy_cros_settings_parser.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 | 268 |
| 270 // WebUI login. | 269 // WebUI login. |
| 271 chromeos::WebUILoginDisplay* webui_login_display = | 270 chromeos::WebUILoginDisplay* webui_login_display = |
| 272 static_cast<chromeos::WebUILoginDisplay*>(controller->login_display()); | 271 static_cast<chromeos::WebUILoginDisplay*>(controller->login_display()); |
| 273 webui_login_display->ShowSigninScreenForCreds(username, password); | 272 webui_login_display->ShowSigninScreenForCreds(username, password); |
| 274 } | 273 } |
| 275 | 274 |
| 276 void TestingAutomationProvider::LockScreen(DictionaryValue* args, | 275 void TestingAutomationProvider::LockScreen(DictionaryValue* args, |
| 277 IPC::Message* reply_message) { | 276 IPC::Message* reply_message) { |
| 278 new ScreenLockUnlockObserver(this, reply_message, true); | 277 new ScreenLockUnlockObserver(this, reply_message, true); |
| 279 CrosLibrary::Get()->GetScreenLockLibrary()-> | 278 DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 280 NotifyScreenLockRequested(); | 279 NotifyScreenLockRequested(); |
| 281 } | 280 } |
| 282 | 281 |
| 283 void TestingAutomationProvider::UnlockScreen(DictionaryValue* args, | 282 void TestingAutomationProvider::UnlockScreen(DictionaryValue* args, |
| 284 IPC::Message* reply_message) { | 283 IPC::Message* reply_message) { |
| 285 std::string password; | 284 std::string password; |
| 286 if (!args->GetString("password", &password)) { | 285 if (!args->GetString("password", &password)) { |
| 287 AutomationJSONReply(this, reply_message).SendError( | 286 AutomationJSONReply(this, reply_message).SendError( |
| 288 "Invalid or missing args."); | 287 "Invalid or missing args."); |
| 289 return; | 288 return; |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1142 views::Widget* window = browser::CreateViewsWindow( | 1141 views::Widget* window = browser::CreateViewsWindow( |
| 1143 browser->window()->GetNativeHandle(), take_photo_dialog); | 1142 browser->window()->GetNativeHandle(), take_photo_dialog); |
| 1144 window->SetAlwaysOnTop(true); | 1143 window->SetAlwaysOnTop(true); |
| 1145 window->Show(); | 1144 window->Show(); |
| 1146 } | 1145 } |
| 1147 | 1146 |
| 1148 void TestingAutomationProvider::PowerChanged( | 1147 void TestingAutomationProvider::PowerChanged( |
| 1149 const chromeos::PowerSupplyStatus& status) { | 1148 const chromeos::PowerSupplyStatus& status) { |
| 1150 power_status = status; | 1149 power_status = status; |
| 1151 } | 1150 } |
| OLD | NEW |