Chromium Code Reviews| 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 RaisedEventObserver 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 AddRaisedEventObserver( | |
|
Nirnimesh
2012/02/24 23:18:09
Add 'dom' or 'app'
craigdh
2012/02/27 22:43:38
Done.
| |
| 958 base::DictionaryValue* args, IPC::Message* reply_message); | |
| 959 | |
| 960 // Retrieves an event from the AutomationEventQueue. | |
| 961 // Blocks if 'blocking' is true, otherwise returns immediately. | |
| 962 // Example: | |
| 963 // input: { "observer_id": 1, | |
| 964 // "blocking": true, | |
| 965 // } | |
| 966 // output: { "type": "raised", | |
| 967 // "name": "login complete" | |
| 968 // "id": 1, | |
| 969 // } | |
| 970 void GetEvent(base::DictionaryValue* args, IPC::Message* reply_message); | |
| 971 | |
| 972 // Removes an event observer associated with the AutomationEventQueue. | |
| 973 // Example: | |
| 974 // input: { "observer_id": 1 } | |
| 975 // output: none | |
| 976 void RemoveEventObserver( | |
|
Nirnimesh
2012/02/24 23:18:09
Move this next to AddRaisedEventObserver
craigdh
2012/02/27 22:43:38
Done.
| |
| 977 base::DictionaryValue* args, IPC::Message* reply_message); | |
| 978 | |
| 979 // Removes all events from the AutomationEventQueue. | |
| 980 // Example: | |
| 981 // input: none | |
| 982 // output: none | |
| 983 void ClearEvents(base::DictionaryValue* args, IPC::Message* reply_message); | |
| 984 | |
| 985 // Removes all event observers associated with the AutomationEventQueue. | |
| 986 // Example: | |
| 987 // input: none | |
| 988 // output: none | |
| 989 void ClearEventObservers( | |
| 990 base::DictionaryValue* args, IPC::Message* reply_message); | |
| 991 | |
| 947 // Executes javascript in the specified frame of a render view. | 992 // Executes javascript in the specified frame of a render view. |
| 948 // Uses the JSON interface. Waits for a result from the | 993 // Uses the JSON interface. Waits for a result from the |
| 949 // |DOMAutomationController|. The javascript must send a string. | 994 // |DOMAutomationController|. The javascript must send a string. |
| 950 // Example: | 995 // Example: |
| 951 // input: { "view": { | 996 // input: { "view": { |
| 952 // "render_process_id": 1, | 997 // "render_process_id": 1, |
| 953 // "render_view_id": 2, | 998 // "render_view_id": 2, |
| 954 // } | 999 // } |
| 955 // "frame_xpath": "//frames[1]", | 1000 // "frame_xpath": "//frames[1]", |
| 956 // "javascript": | 1001 // "javascript": |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1556 HistoryService::Handle redirect_query_; | 1601 HistoryService::Handle redirect_query_; |
| 1557 | 1602 |
| 1558 content::NotificationRegistrar registrar_; | 1603 content::NotificationRegistrar registrar_; |
| 1559 | 1604 |
| 1560 // Used to enumerate browser profiles. | 1605 // Used to enumerate browser profiles. |
| 1561 scoped_refptr<ImporterList> importer_list_; | 1606 scoped_refptr<ImporterList> importer_list_; |
| 1562 | 1607 |
| 1563 // The stored data for the ImportSettings operation. | 1608 // The stored data for the ImportSettings operation. |
| 1564 ImportSettingsData import_settings_data_; | 1609 ImportSettingsData import_settings_data_; |
| 1565 | 1610 |
| 1611 // The automation event observer queue. | |
| 1612 AutomationEventQueue automation_event_queue_; | |
| 1613 | |
| 1566 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); | 1614 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); |
| 1567 }; | 1615 }; |
| 1568 | 1616 |
| 1569 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 1617 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
| OLD | NEW |