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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 if (!controller) { | 392 if (!controller) { |
393 // This may happen due to SkipToLogin not being called. | 393 // This may happen due to SkipToLogin not being called. |
394 reply.SendError("Unable to access ExistingUserController"); | 394 reply.SendError("Unable to access ExistingUserController"); |
395 return; | 395 return; |
396 } | 396 } |
397 | 397 |
398 if (!automation_event_queue_.get()) | 398 if (!automation_event_queue_.get()) |
399 automation_event_queue_.reset(new AutomationEventQueue); | 399 automation_event_queue_.reset(new AutomationEventQueue); |
400 | 400 |
401 int observer_id = automation_event_queue_->AddObserver( | 401 int observer_id = automation_event_queue_->AddObserver( |
402 new LoginEventObserver(automation_event_queue_.get(), | 402 new LoginEventObserver(automation_event_queue_.get(), this)); |
403 controller, this)); | |
404 | 403 |
405 // Return the observer's id. | 404 // Return the observer's id. |
406 DictionaryValue return_value; | 405 DictionaryValue return_value; |
407 return_value.SetInteger("observer_id", observer_id); | 406 return_value.SetInteger("observer_id", observer_id); |
408 reply.SendSuccess(&return_value); | 407 reply.SendSuccess(&return_value); |
409 } | 408 } |
410 | 409 |
411 void TestingAutomationProvider::SignOut(DictionaryValue* args, | 410 void TestingAutomationProvider::SignOut(DictionaryValue* args, |
412 IPC::Message* reply_message) { | 411 IPC::Message* reply_message) { |
413 ash::Shell::GetInstance()->tray_delegate()->SignOut(); | 412 ash::Shell::GetInstance()->tray_delegate()->SignOut(); |
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1511 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1513 AddObserver(power_manager_observer_); | 1512 AddObserver(power_manager_observer_); |
1514 } | 1513 } |
1515 | 1514 |
1516 void TestingAutomationProvider::RemoveChromeosObservers() { | 1515 void TestingAutomationProvider::RemoveChromeosObservers() { |
1517 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1516 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1518 RemoveObserver(power_manager_observer_); | 1517 RemoveObserver(power_manager_observer_); |
1519 delete power_manager_observer_; | 1518 delete power_manager_observer_; |
1520 power_manager_observer_ = NULL; | 1519 power_manager_observer_ = NULL; |
1521 } | 1520 } |
OLD | NEW |