OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "chrome/browser/policy/cloud_policy_data_store.h" | 40 #include "chrome/browser/policy/cloud_policy_data_store.h" |
41 #include "chrome/browser/policy/cloud_policy_subsystem.h" | 41 #include "chrome/browser/policy/cloud_policy_subsystem.h" |
42 #include "chrome/browser/policy/enterprise_install_attributes.h" | 42 #include "chrome/browser/policy/enterprise_install_attributes.h" |
43 #include "chrome/browser/prefs/pref_service.h" | 43 #include "chrome/browser/prefs/pref_service.h" |
44 #include "chrome/browser/ui/browser.h" | 44 #include "chrome/browser/ui/browser.h" |
45 #include "chrome/browser/ui/browser_window.h" | 45 #include "chrome/browser/ui/browser_window.h" |
46 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 46 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
47 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
48 #include "chromeos/dbus/dbus_thread_manager.h" | 48 #include "chromeos/dbus/dbus_thread_manager.h" |
49 #include "chromeos/dbus/power_manager_client.h" | 49 #include "chromeos/dbus/power_manager_client.h" |
| 50 #include "chromeos/dbus/session_manager_client.h" |
50 #include "chromeos/dbus/update_engine_client.h" | 51 #include "chromeos/dbus/update_engine_client.h" |
51 #include "content/public/browser/web_contents.h" | 52 #include "content/public/browser/web_contents.h" |
52 #include "net/base/network_change_notifier.h" | 53 #include "net/base/network_change_notifier.h" |
53 #include "policy/policy_constants.h" | 54 #include "policy/policy_constants.h" |
54 #include "ui/views/widget/widget.h" | 55 #include "ui/views/widget/widget.h" |
55 | 56 |
56 using chromeos::CrosLibrary; | 57 using chromeos::CrosLibrary; |
57 using chromeos::DBusThreadManager; | 58 using chromeos::DBusThreadManager; |
58 using chromeos::ExistingUserController; | 59 using chromeos::ExistingUserController; |
59 using chromeos::NetworkLibrary; | 60 using chromeos::NetworkLibrary; |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 // Already logged in. | 509 // Already logged in. |
509 reply.SendSuccess(NULL); | 510 reply.SendSuccess(NULL); |
510 return; | 511 return; |
511 } | 512 } |
512 reply.SendSuccess(return_value.get()); | 513 reply.SendSuccess(return_value.get()); |
513 } | 514 } |
514 | 515 |
515 void TestingAutomationProvider::LockScreen(DictionaryValue* args, | 516 void TestingAutomationProvider::LockScreen(DictionaryValue* args, |
516 IPC::Message* reply_message) { | 517 IPC::Message* reply_message) { |
517 new ScreenLockUnlockObserver(this, reply_message, true); | 518 new ScreenLockUnlockObserver(this, reply_message, true); |
518 DBusThreadManager::Get()->GetPowerManagerClient()-> | 519 DBusThreadManager::Get()->GetSessionManagerClient()->RequestLockScreen(); |
519 NotifyScreenLockRequested(); | |
520 } | 520 } |
521 | 521 |
522 void TestingAutomationProvider::UnlockScreen(DictionaryValue* args, | 522 void TestingAutomationProvider::UnlockScreen(DictionaryValue* args, |
523 IPC::Message* reply_message) { | 523 IPC::Message* reply_message) { |
524 std::string password; | 524 std::string password; |
525 if (!args->GetString("password", &password)) { | 525 if (!args->GetString("password", &password)) { |
526 AutomationJSONReply(this, reply_message).SendError( | 526 AutomationJSONReply(this, reply_message).SendError( |
527 "Invalid or missing args."); | 527 "Invalid or missing args."); |
528 return; | 528 return; |
529 } | 529 } |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1455 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1456 AddObserver(power_manager_observer_); | 1456 AddObserver(power_manager_observer_); |
1457 } | 1457 } |
1458 | 1458 |
1459 void TestingAutomationProvider::RemoveChromeosObservers() { | 1459 void TestingAutomationProvider::RemoveChromeosObservers() { |
1460 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1460 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1461 RemoveObserver(power_manager_observer_); | 1461 RemoveObserver(power_manager_observer_); |
1462 delete power_manager_observer_; | 1462 delete power_manager_observer_; |
1463 power_manager_observer_ = NULL; | 1463 power_manager_observer_ = NULL; |
1464 } | 1464 } |
OLD | NEW |