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 #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 <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "chrome/browser/automation/automation_event_observer.h" | |
17 #include "chrome/browser/automation/automation_event_queue.h" | |
16 #include "chrome/browser/automation/automation_provider.h" | 18 #include "chrome/browser/automation/automation_provider.h" |
17 #include "chrome/browser/automation/automation_provider_json.h" | 19 #include "chrome/browser/automation/automation_provider_json.h" |
18 #include "chrome/browser/history/history.h" | 20 #include "chrome/browser/history/history.h" |
19 #include "chrome/browser/importer/importer_list_observer.h" | 21 #include "chrome/browser/importer/importer_list_observer.h" |
20 #include "chrome/browser/sync/profile_sync_service_harness.h" | 22 #include "chrome/browser/sync/profile_sync_service_harness.h" |
21 #include "chrome/browser/ui/browser_list.h" | 23 #include "chrome/browser/ui/browser_list.h" |
22 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
23 #include "content/public/common/page_type.h" | 25 #include "content/public/common/page_type.h" |
24 #include "content/public/common/security_style.h" | 26 #include "content/public/common/security_style.h" |
25 #include "net/base/cert_status_flags.h" | 27 #include "net/base/cert_status_flags.h" |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
937 // output: { "result": "My Window Name" } | 939 // output: { "result": "My Window Name" } |
938 // This and some following methods have a suffix of JSON to distingush them | 940 // This and some following methods have a suffix of JSON to distingush them |
939 // from already existing methods which perform the same function, but use | 941 // from already existing methods which perform the same function, but use |
940 // custom IPC messages instead of the JSON IPC message. These functions will | 942 // custom IPC messages instead of the JSON IPC message. These functions will |
941 // eventually be replaced with the JSON ones and the JSON suffix will be | 943 // eventually be replaced with the JSON ones and the JSON suffix will be |
942 // dropped. | 944 // dropped. |
943 // TODO(kkania): Replace the non-JSON counterparts and drop the JSON suffix. | 945 // TODO(kkania): Replace the non-JSON counterparts and drop the JSON suffix. |
944 void ExecuteJavascriptJSON( | 946 void ExecuteJavascriptJSON( |
945 base::DictionaryValue* args, IPC::Message* reply_message); | 947 base::DictionaryValue* args, IPC::Message* reply_message); |
946 | 948 |
949 // Creates a DomRaisedEventObserver associated with the AutomationEventQueue. | |
950 // Example: | |
951 // input: { "event_name": "login complete", | |
952 // "windex": 1, | |
953 // "tab_index": 1, | |
954 // "frame_xpath": "//frames[1]", | |
955 // } | |
956 // output: { "observer_id": 1 } | |
957 void AddDomRaisedEventObserver( | |
958 base::DictionaryValue* args, IPC::Message* reply_message); | |
959 | |
960 // Removes an event observer associated with the AutomationEventQueue. | |
961 // Example: | |
962 // input: { "observer_id": 1 } | |
963 // output: none | |
964 void RemoveEventObserver( | |
965 base::DictionaryValue* args, IPC::Message* reply_message); | |
966 | |
967 // Retrieves an event from the AutomationEventQueue. | |
968 // Blocks if 'blocking' is true, otherwise returns immediately. | |
969 // Example: | |
970 // input: { "observer_id": 1, | |
971 // "blocking": true, | |
972 // } | |
973 // output: { "type": "raised", | |
974 // "name": "login complete" | |
975 // "id": 1, | |
976 // } | |
977 void GetNextEvent(base::DictionaryValue* args, IPC::Message* reply_message); | |
978 | |
979 // Removes all events and observers attached to the AutomationEventQueue. | |
980 // Example: | |
981 // input: none | |
982 // output: none | |
983 void ClearEventQueue( | |
984 base::DictionaryValue* args, IPC::Message* reply_message); | |
985 | |
947 // Executes javascript in the specified frame of a render view. | 986 // Executes javascript in the specified frame of a render view. |
948 // Uses the JSON interface. Waits for a result from the | 987 // Uses the JSON interface. Waits for a result from the |
949 // |DOMAutomationController|. The javascript must send a string. | 988 // |DOMAutomationController|. The javascript must send a string. |
950 // Example: | 989 // Example: |
951 // input: { "view": { | 990 // input: { "view": { |
952 // "render_process_id": 1, | 991 // "render_process_id": 1, |
953 // "render_view_id": 2, | 992 // "render_view_id": 2, |
954 // } | 993 // } |
955 // "frame_xpath": "//frames[1]", | 994 // "frame_xpath": "//frames[1]", |
956 // "javascript": | 995 // "javascript": |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1556 HistoryService::Handle redirect_query_; | 1595 HistoryService::Handle redirect_query_; |
1557 | 1596 |
1558 content::NotificationRegistrar registrar_; | 1597 content::NotificationRegistrar registrar_; |
1559 | 1598 |
1560 // Used to enumerate browser profiles. | 1599 // Used to enumerate browser profiles. |
1561 scoped_refptr<ImporterList> importer_list_; | 1600 scoped_refptr<ImporterList> importer_list_; |
1562 | 1601 |
1563 // The stored data for the ImportSettings operation. | 1602 // The stored data for the ImportSettings operation. |
1564 ImportSettingsData import_settings_data_; | 1603 ImportSettingsData import_settings_data_; |
1565 | 1604 |
1605 // The automation event observer queue. | |
1606 AutomationEventQueue automation_event_queue_; | |
Nirnimesh
2012/02/29 03:22:08
Does this have to be allocated on the stack? It'll
craigdh
2012/02/29 22:53:43
A scoped_ptr seems reasonable.
| |
1607 | |
1566 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); | 1608 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); |
1567 }; | 1609 }; |
1568 | 1610 |
1569 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 1611 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
OLD | NEW |