| 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 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 DictionaryValue* args, | 1409 DictionaryValue* args, |
| 1410 IPC::Message* reply_message) { | 1410 IPC::Message* reply_message) { |
| 1411 chromeos::TakePhotoDialog* take_photo_dialog = | 1411 chromeos::TakePhotoDialog* take_photo_dialog = |
| 1412 new chromeos::TakePhotoDialog(NULL); | 1412 new chromeos::TakePhotoDialog(NULL); |
| 1413 | 1413 |
| 1414 // Set up an observer (it will delete itself). | 1414 // Set up an observer (it will delete itself). |
| 1415 take_photo_dialog->AddObserver(new PhotoCaptureObserver( | 1415 take_photo_dialog->AddObserver(new PhotoCaptureObserver( |
| 1416 this, reply_message)); | 1416 this, reply_message)); |
| 1417 | 1417 |
| 1418 views::Widget* window = views::Widget::CreateWindowWithParent( | 1418 views::Widget* window = views::Widget::CreateWindowWithParent( |
| 1419 take_photo_dialog, browser->window()->GetNativeHandle()); | 1419 take_photo_dialog, browser->window()->GetNativeWindow()); |
| 1420 window->SetAlwaysOnTop(true); | 1420 window->SetAlwaysOnTop(true); |
| 1421 window->Show(); | 1421 window->Show(); |
| 1422 } | 1422 } |
| 1423 | 1423 |
| 1424 void TestingAutomationProvider::AddChromeosObservers() { | 1424 void TestingAutomationProvider::AddChromeosObservers() { |
| 1425 power_manager_observer_ = new PowerManagerClientObserverForTesting; | 1425 power_manager_observer_ = new PowerManagerClientObserverForTesting; |
| 1426 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1426 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 1427 AddObserver(power_manager_observer_); | 1427 AddObserver(power_manager_observer_); |
| 1428 } | 1428 } |
| 1429 | 1429 |
| 1430 void TestingAutomationProvider::RemoveChromeosObservers() { | 1430 void TestingAutomationProvider::RemoveChromeosObservers() { |
| 1431 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1431 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 1432 RemoveObserver(power_manager_observer_); | 1432 RemoveObserver(power_manager_observer_); |
| 1433 delete power_manager_observer_; | 1433 delete power_manager_observer_; |
| 1434 power_manager_observer_ = NULL; | 1434 power_manager_observer_ = NULL; |
| 1435 } | 1435 } |
| OLD | NEW |