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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 | 466 |
467 chromeos::ScreenLocker* screen_locker = | 467 chromeos::ScreenLocker* screen_locker = |
468 chromeos::ScreenLocker::default_screen_locker(); | 468 chromeos::ScreenLocker::default_screen_locker(); |
469 if (!screen_locker) { | 469 if (!screen_locker) { |
470 AutomationJSONReply(this, reply_message).SendError( | 470 AutomationJSONReply(this, reply_message).SendError( |
471 "No default screen locker. Are you sure the screen is locked?"); | 471 "No default screen locker. Are you sure the screen is locked?"); |
472 return; | 472 return; |
473 } | 473 } |
474 | 474 |
475 new ScreenUnlockObserver(this, reply_message); | 475 new ScreenUnlockObserver(this, reply_message); |
476 screen_locker->Authenticate(ASCIIToUTF16(password)); | 476 screen_locker->AuthenticateByPassword(password); |
477 } | 477 } |
478 | 478 |
479 // Signing out could have undesirable side effects: session_manager is | 479 // Signing out could have undesirable side effects: session_manager is |
480 // killed, so its children, including chrome and the window manager, will | 480 // killed, so its children, including chrome and the window manager, will |
481 // also be killed. Anything owned by chronos will probably be killed. | 481 // also be killed. Anything owned by chronos will probably be killed. |
482 void TestingAutomationProvider::SignoutInScreenLocker( | 482 void TestingAutomationProvider::SignoutInScreenLocker( |
483 DictionaryValue* args, IPC::Message* reply_message) { | 483 DictionaryValue* args, IPC::Message* reply_message) { |
484 AutomationJSONReply reply(this, reply_message); | 484 AutomationJSONReply reply(this, reply_message); |
485 chromeos::ScreenLocker* screen_locker = | 485 chromeos::ScreenLocker* screen_locker = |
486 chromeos::ScreenLocker::default_screen_locker(); | 486 chromeos::ScreenLocker::default_screen_locker(); |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1267 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1268 AddObserver(power_manager_observer_); | 1268 AddObserver(power_manager_observer_); |
1269 } | 1269 } |
1270 | 1270 |
1271 void TestingAutomationProvider::RemoveChromeosObservers() { | 1271 void TestingAutomationProvider::RemoveChromeosObservers() { |
1272 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1272 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1273 RemoveObserver(power_manager_observer_); | 1273 RemoveObserver(power_manager_observer_); |
1274 delete power_manager_observer_; | 1274 delete power_manager_observer_; |
1275 power_manager_observer_ = NULL; | 1275 power_manager_observer_ = NULL; |
1276 } | 1276 } |
OLD | NEW |