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 #ifndef CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
6 #define CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/automation/automation_provider.h" | 14 #include "chrome/browser/automation/automation_provider.h" |
15 #include "chrome/browser/automation/automation_provider_json.h" | 15 #include "chrome/browser/automation/automation_provider_json.h" |
16 #include "chrome/browser/history/history.h" | 16 #include "chrome/browser/history/history.h" |
17 #include "chrome/browser/importer/importer_list_observer.h" | 17 #include "chrome/browser/importer/importer_list_observer.h" |
18 #include "chrome/browser/sync/profile_sync_service_harness.h" | 18 #include "chrome/browser/sync/profile_sync_service_harness.h" |
19 #include "chrome/browser/ui/browser_list.h" | 19 #include "chrome/browser/ui/browser_list.h" |
20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
21 #include "content/public/common/page_type.h" | 21 #include "content/public/common/page_type.h" |
22 #include "net/base/cert_status_flags.h" | 22 #include "net/base/cert_status_flags.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
24 | 24 |
25 #if defined(OS_CHROMEOS) | |
26 #include "chrome/browser/chromeos/cros/power_library.h" | |
27 #endif // defined(OS_CHROMEOS) | |
28 | |
25 class ImporterList; | 29 class ImporterList; |
26 class TemplateURLService; | 30 class TemplateURLService; |
27 | 31 |
28 namespace base { | 32 namespace base { |
29 class DictionaryValue; | 33 class DictionaryValue; |
30 } | 34 } |
31 | 35 |
32 namespace webkit { | 36 namespace webkit { |
33 struct WebPluginInfo; | 37 struct WebPluginInfo; |
34 } | 38 } |
35 | 39 |
36 // This is an automation provider containing testing calls. | 40 // This is an automation provider containing testing calls. |
37 class TestingAutomationProvider : public AutomationProvider, | 41 class TestingAutomationProvider : public AutomationProvider, |
38 public BrowserList::Observer, | 42 public BrowserList::Observer, |
39 public importer::ImporterListObserver, | 43 public importer::ImporterListObserver, |
44 #if defined(OS_CHROMEOS) | |
45 public chromeos::PowerLibrary::Observer, | |
stevenjb
2011/10/24 20:36:21
We should really have a TestingAutomationProviderC
Simon Que
2011/10/24 22:49:48
Can this be done in a later patch?
stevenjb
2011/10/25 02:33:19
I am reluctant to introduce new #ifdefs into such
Simon Que
2011/10/25 19:30:47
I'm having a bit of trouble with this due to the c
| |
46 #endif // defined(OS_CHROMEOS) | |
40 public content::NotificationObserver { | 47 public content::NotificationObserver { |
48 | |
41 public: | 49 public: |
42 explicit TestingAutomationProvider(Profile* profile); | 50 explicit TestingAutomationProvider(Profile* profile); |
43 | 51 |
44 virtual IPC::Channel::Mode GetChannelMode(bool use_named_interface); | 52 virtual IPC::Channel::Mode GetChannelMode(bool use_named_interface); |
45 | 53 |
46 // IPC::Channel::Listener: | 54 // IPC::Channel::Listener: |
47 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 55 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
48 virtual void OnChannelError() OVERRIDE; | 56 virtual void OnChannelError() OVERRIDE; |
49 | 57 |
50 private: | 58 private: |
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1336 // Volume. | 1344 // Volume. |
1337 void GetVolumeInfo(base::DictionaryValue* args, IPC::Message* reply_message); | 1345 void GetVolumeInfo(base::DictionaryValue* args, IPC::Message* reply_message); |
1338 | 1346 |
1339 void SetVolume(base::DictionaryValue* args, IPC::Message* reply_message); | 1347 void SetVolume(base::DictionaryValue* args, IPC::Message* reply_message); |
1340 | 1348 |
1341 void SetMute(base::DictionaryValue* args, IPC::Message* reply_message); | 1349 void SetMute(base::DictionaryValue* args, IPC::Message* reply_message); |
1342 | 1350 |
1343 void CaptureProfilePhoto(Browser* browser, | 1351 void CaptureProfilePhoto(Browser* browser, |
1344 DictionaryValue* args, | 1352 DictionaryValue* args, |
1345 IPC::Message* reply_message); | 1353 IPC::Message* reply_message); |
1354 | |
1355 // chromeos::PowerLibrary::Observer overrides. | |
1356 virtual void PowerChanged(const chromeos::PowerSupplyStatus& status) OVERRIDE; | |
1357 virtual void SystemResumed() OVERRIDE {} | |
1346 #endif // defined(OS_CHROMEOS) | 1358 #endif // defined(OS_CHROMEOS) |
1347 | 1359 |
1348 void WaitForTabCountToBecome(int browser_handle, | 1360 void WaitForTabCountToBecome(int browser_handle, |
1349 int target_tab_count, | 1361 int target_tab_count, |
1350 IPC::Message* reply_message); | 1362 IPC::Message* reply_message); |
1351 | 1363 |
1352 void WaitForInfoBarCount(int tab_handle, | 1364 void WaitForInfoBarCount(int tab_handle, |
1353 size_t target_count, | 1365 size_t target_count, |
1354 IPC::Message* reply_message); | 1366 IPC::Message* reply_message); |
1355 | 1367 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1404 HistoryService::Handle redirect_query_; | 1416 HistoryService::Handle redirect_query_; |
1405 | 1417 |
1406 content::NotificationRegistrar registrar_; | 1418 content::NotificationRegistrar registrar_; |
1407 | 1419 |
1408 // Used to enumerate browser profiles. | 1420 // Used to enumerate browser profiles. |
1409 scoped_refptr<ImporterList> importer_list_; | 1421 scoped_refptr<ImporterList> importer_list_; |
1410 | 1422 |
1411 // The stored data for the ImportSettings operation. | 1423 // The stored data for the ImportSettings operation. |
1412 ImportSettingsData import_settings_data_; | 1424 ImportSettingsData import_settings_data_; |
1413 | 1425 |
1426 #if defined(OS_CHROMEOS) | |
1427 // Last reported power status. | |
1428 chromeos::PowerSupplyStatus power_status_; | |
1429 #endif // defined(OS_CHROMEOS) | |
stevenjb
2011/10/24 20:36:21
We should just make this a static variable in the
Simon Que
2011/10/24 22:49:48
Done.
| |
1430 | |
1414 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); | 1431 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); |
1415 }; | 1432 }; |
1416 | 1433 |
1417 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 1434 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
OLD | NEW |