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/chromeos/cros/power_library.h" | |
satorux1
2011/10/20 04:32:40
Hmm, testing_automation_provider.h seems to be sha
Simon Que
2011/10/20 21:18:53
Done.
| |
16 #include "chrome/browser/history/history.h" | 17 #include "chrome/browser/history/history.h" |
17 #include "chrome/browser/importer/importer_list_observer.h" | 18 #include "chrome/browser/importer/importer_list_observer.h" |
18 #include "chrome/browser/sync/profile_sync_service_harness.h" | 19 #include "chrome/browser/sync/profile_sync_service_harness.h" |
19 #include "chrome/browser/ui/browser_list.h" | 20 #include "chrome/browser/ui/browser_list.h" |
20 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
21 #include "content/public/common/page_type.h" | 22 #include "content/public/common/page_type.h" |
22 #include "net/base/cert_status_flags.h" | 23 #include "net/base/cert_status_flags.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
24 | 25 |
25 class ImporterList; | 26 class ImporterList; |
26 class TemplateURLService; | 27 class TemplateURLService; |
27 | 28 |
28 namespace base { | 29 namespace base { |
29 class DictionaryValue; | 30 class DictionaryValue; |
30 } | 31 } |
31 | 32 |
32 namespace webkit { | 33 namespace webkit { |
33 struct WebPluginInfo; | 34 struct WebPluginInfo; |
34 } | 35 } |
35 | 36 |
36 // This is an automation provider containing testing calls. | 37 // This is an automation provider containing testing calls. |
37 class TestingAutomationProvider : public AutomationProvider, | 38 class TestingAutomationProvider : public AutomationProvider, |
38 public BrowserList::Observer, | 39 public BrowserList::Observer, |
39 public importer::ImporterListObserver, | 40 public importer::ImporterListObserver, |
40 public content::NotificationObserver { | 41 public content::NotificationObserver, |
42 public chromeos::PowerLibrary::Observer { | |
43 | |
41 public: | 44 public: |
42 explicit TestingAutomationProvider(Profile* profile); | 45 explicit TestingAutomationProvider(Profile* profile); |
43 | 46 |
44 virtual IPC::Channel::Mode GetChannelMode(bool use_named_interface); | 47 virtual IPC::Channel::Mode GetChannelMode(bool use_named_interface); |
45 | 48 |
46 // IPC::Channel::Listener: | 49 // IPC::Channel::Listener: |
47 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 50 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
48 virtual void OnChannelError() OVERRIDE; | 51 virtual void OnChannelError() OVERRIDE; |
49 | 52 |
53 virtual void PowerChanged(const chromeos::PowerSupplyStatus& status) OVERRIDE; | |
54 virtual void SystemResumed() OVERRIDE {} | |
55 | |
50 private: | 56 private: |
51 class PopupMenuWaiter; | 57 class PopupMenuWaiter; |
52 | 58 |
53 // Storage for ImportSettings() to resume operations after a callback. | 59 // Storage for ImportSettings() to resume operations after a callback. |
54 struct ImportSettingsData { | 60 struct ImportSettingsData { |
55 string16 browser_name; | 61 string16 browser_name; |
56 int import_items; | 62 int import_items; |
57 bool first_run; | 63 bool first_run; |
58 Browser* browser; | 64 Browser* browser; |
59 IPC::Message* reply_message; | 65 IPC::Message* reply_message; |
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1403 HistoryService::Handle redirect_query_; | 1409 HistoryService::Handle redirect_query_; |
1404 | 1410 |
1405 content::NotificationRegistrar registrar_; | 1411 content::NotificationRegistrar registrar_; |
1406 | 1412 |
1407 // Used to enumerate browser profiles. | 1413 // Used to enumerate browser profiles. |
1408 scoped_refptr<ImporterList> importer_list_; | 1414 scoped_refptr<ImporterList> importer_list_; |
1409 | 1415 |
1410 // The stored data for the ImportSettings operation. | 1416 // The stored data for the ImportSettings operation. |
1411 ImportSettingsData import_settings_data_; | 1417 ImportSettingsData import_settings_data_; |
1412 | 1418 |
1419 // Last reported power status. | |
1420 chromeos::PowerSupplyStatus power_status_; | |
1421 | |
1413 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); | 1422 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); |
1414 }; | 1423 }; |
1415 | 1424 |
1416 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 1425 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
OLD | NEW |