Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(800)

Side by Side Diff: chrome/browser/automation/testing_automation_provider_chromeos.cc

Issue 8664014: chromeos: move screen lock handling to power manager client (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebased Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/screen_lock_library.h"
19 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" 18 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
19 #include "chrome/browser/chromeos/dbus/power_manager_client.h"
20 #include "chrome/browser/chromeos/dbus/update_engine_client.h" 20 #include "chrome/browser/chromeos/dbus/update_engine_client.h"
21 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen. h" 21 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen. h"
22 #include "chrome/browser/chromeos/login/existing_user_controller.h" 22 #include "chrome/browser/chromeos/login/existing_user_controller.h"
23 #include "chrome/browser/chromeos/login/login_display.h" 23 #include "chrome/browser/chromeos/login/login_display.h"
24 #include "chrome/browser/chromeos/login/login_display_host.h" 24 #include "chrome/browser/chromeos/login/login_display_host.h"
25 #include "chrome/browser/chromeos/login/screen_locker.h" 25 #include "chrome/browser/chromeos/login/screen_locker.h"
26 #include "chrome/browser/chromeos/login/webui_login_display.h" 26 #include "chrome/browser/chromeos/login/webui_login_display.h"
27 #include "chrome/browser/chromeos/login/wizard_controller.h" 27 #include "chrome/browser/chromeos/login/wizard_controller.h"
28 #include "chrome/browser/chromeos/options/take_photo_dialog.h" 28 #include "chrome/browser/chromeos/options/take_photo_dialog.h"
29 #include "chrome/browser/chromeos/proxy_cros_settings_parser.h" 29 #include "chrome/browser/chromeos/proxy_cros_settings_parser.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 // WebUI login. 270 // WebUI login.
271 chromeos::WebUILoginDisplay* webui_login_display = 271 chromeos::WebUILoginDisplay* webui_login_display =
272 static_cast<chromeos::WebUILoginDisplay*>(controller->login_display()); 272 static_cast<chromeos::WebUILoginDisplay*>(controller->login_display());
273 webui_login_display->ShowSigninScreenForCreds(username, password); 273 webui_login_display->ShowSigninScreenForCreds(username, password);
274 } 274 }
275 275
276 void TestingAutomationProvider::LockScreen(DictionaryValue* args, 276 void TestingAutomationProvider::LockScreen(DictionaryValue* args,
277 IPC::Message* reply_message) { 277 IPC::Message* reply_message) {
278 new ScreenLockUnlockObserver(this, reply_message, true); 278 new ScreenLockUnlockObserver(this, reply_message, true);
279 CrosLibrary::Get()->GetScreenLockLibrary()-> 279 DBusThreadManager::Get()->GetPowerManagerClient()->
280 NotifyScreenLockRequested(); 280 NotifyScreenLockRequested();
281 } 281 }
282 282
283 void TestingAutomationProvider::UnlockScreen(DictionaryValue* args, 283 void TestingAutomationProvider::UnlockScreen(DictionaryValue* args,
284 IPC::Message* reply_message) { 284 IPC::Message* reply_message) {
285 std::string password; 285 std::string password;
286 if (!args->GetString("password", &password)) { 286 if (!args->GetString("password", &password)) {
287 AutomationJSONReply(this, reply_message).SendError( 287 AutomationJSONReply(this, reply_message).SendError(
288 "Invalid or missing args."); 288 "Invalid or missing args.");
289 return; 289 return;
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 views::Widget* window = browser::CreateViewsWindow( 1142 views::Widget* window = browser::CreateViewsWindow(
1143 browser->window()->GetNativeHandle(), take_photo_dialog, STYLE_GENERIC); 1143 browser->window()->GetNativeHandle(), take_photo_dialog, STYLE_GENERIC);
1144 window->SetAlwaysOnTop(true); 1144 window->SetAlwaysOnTop(true);
1145 window->Show(); 1145 window->Show();
1146 } 1146 }
1147 1147
1148 void TestingAutomationProvider::PowerChanged( 1148 void TestingAutomationProvider::PowerChanged(
1149 const chromeos::PowerSupplyStatus& status) { 1149 const chromeos::PowerSupplyStatus& status) {
1150 power_status = status; 1150 power_status = status;
1151 } 1151 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698