OLD | NEW |
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 <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 #include "webkit/plugins/webplugininfo.h" | 126 #include "webkit/plugins/webplugininfo.h" |
127 | 127 |
128 #if defined(ENABLE_CONFIGURATION_POLICY) | 128 #if defined(ENABLE_CONFIGURATION_POLICY) |
129 #include "chrome/browser/policy/browser_policy_connector.h" | 129 #include "chrome/browser/policy/browser_policy_connector.h" |
130 #include "chrome/browser/policy/configuration_policy_provider.h" | 130 #include "chrome/browser/policy/configuration_policy_provider.h" |
131 #include "chrome/browser/policy/policy_map.h" | 131 #include "chrome/browser/policy/policy_map.h" |
132 #include "policy/policy_constants.h" | 132 #include "policy/policy_constants.h" |
133 #endif | 133 #endif |
134 | 134 |
135 #if defined(OS_CHROMEOS) | 135 #if defined(OS_CHROMEOS) |
| 136 #include "chrome/browser/chromeos/cros/cros_library.h" |
136 #include "chrome/browser/ui/webui/active_downloads_ui.h" | 137 #include "chrome/browser/ui/webui/active_downloads_ui.h" |
137 #else | 138 #else |
138 #include "chrome/browser/download/download_shelf.h" | 139 #include "chrome/browser/download/download_shelf.h" |
139 #endif | 140 #endif |
140 | 141 |
141 using automation_util::SendErrorIfModalDialogActive; | 142 using automation_util::SendErrorIfModalDialogActive; |
142 | 143 |
143 namespace { | 144 namespace { |
144 | 145 |
145 void SendMouseClick(int flags) { | 146 void SendMouseClick(int flags) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 182 |
182 TestingAutomationProvider::TestingAutomationProvider(Profile* profile) | 183 TestingAutomationProvider::TestingAutomationProvider(Profile* profile) |
183 : AutomationProvider(profile), | 184 : AutomationProvider(profile), |
184 #if defined(TOOLKIT_VIEWS) | 185 #if defined(TOOLKIT_VIEWS) |
185 popup_menu_waiter_(NULL), | 186 popup_menu_waiter_(NULL), |
186 #endif | 187 #endif |
187 redirect_query_(0) { | 188 redirect_query_(0) { |
188 BrowserList::AddObserver(this); | 189 BrowserList::AddObserver(this); |
189 registrar_.Add(this, chrome::NOTIFICATION_SESSION_END, | 190 registrar_.Add(this, chrome::NOTIFICATION_SESSION_END, |
190 content::NotificationService::AllSources()); | 191 content::NotificationService::AllSources()); |
| 192 #if defined(OS_CHROMEOS) |
| 193 chromeos::CrosLibrary::Get()->GetPowerLibrary()->AddObserver(this); |
| 194 #endif |
191 } | 195 } |
192 | 196 |
193 TestingAutomationProvider::~TestingAutomationProvider() { | 197 TestingAutomationProvider::~TestingAutomationProvider() { |
194 BrowserList::RemoveObserver(this); | 198 BrowserList::RemoveObserver(this); |
195 } | 199 } |
196 | 200 |
197 IPC::Channel::Mode TestingAutomationProvider::GetChannelMode( | 201 IPC::Channel::Mode TestingAutomationProvider::GetChannelMode( |
198 bool use_named_interface) { | 202 bool use_named_interface) { |
199 if (use_named_interface) | 203 if (use_named_interface) |
200 #if defined(OS_POSIX) | 204 #if defined(OS_POSIX) |
(...skipping 6326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6527 | 6531 |
6528 Send(reply_message_); | 6532 Send(reply_message_); |
6529 redirect_query_ = 0; | 6533 redirect_query_ = 0; |
6530 reply_message_ = NULL; | 6534 reply_message_ = NULL; |
6531 } | 6535 } |
6532 | 6536 |
6533 void TestingAutomationProvider::OnRemoveProvider() { | 6537 void TestingAutomationProvider::OnRemoveProvider() { |
6534 if (g_browser_process) | 6538 if (g_browser_process) |
6535 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6539 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6536 } | 6540 } |
OLD | NEW |