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> |
(...skipping 22 matching lines...) Expand all Loading... | |
33 #endif // defined(OS_CHROMEOS) | 33 #endif // defined(OS_CHROMEOS) |
34 | 34 |
35 class AutofillProfile; | 35 class AutofillProfile; |
36 class CreditCard; | 36 class CreditCard; |
37 class ImporterList; | 37 class ImporterList; |
38 | 38 |
39 namespace base { | 39 namespace base { |
40 class DictionaryValue; | 40 class DictionaryValue; |
41 } | 41 } |
42 | 42 |
43 namespace content { | |
44 class RenderViewHost; | |
45 } | |
46 | |
43 namespace webkit { | 47 namespace webkit { |
44 struct WebPluginInfo; | 48 struct WebPluginInfo; |
45 } | 49 } |
46 | 50 |
47 // This is an automation provider containing testing calls. | 51 // This is an automation provider containing testing calls. |
48 class TestingAutomationProvider : public AutomationProvider, | 52 class TestingAutomationProvider : public AutomationProvider, |
49 public BrowserList::Observer, | 53 public BrowserList::Observer, |
50 public importer::ImporterListObserver, | 54 public importer::ImporterListObserver, |
51 public content::NotificationObserver { | 55 public content::NotificationObserver { |
52 public: | 56 public: |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
978 // output: { "result": "My Window Name" } | 982 // output: { "result": "My Window Name" } |
979 // This and some following methods have a suffix of JSON to distingush them | 983 // This and some following methods have a suffix of JSON to distingush them |
980 // from already existing methods which perform the same function, but use | 984 // from already existing methods which perform the same function, but use |
981 // custom IPC messages instead of the JSON IPC message. These functions will | 985 // custom IPC messages instead of the JSON IPC message. These functions will |
982 // eventually be replaced with the JSON ones and the JSON suffix will be | 986 // eventually be replaced with the JSON ones and the JSON suffix will be |
983 // dropped. | 987 // dropped. |
984 // TODO(kkania): Replace the non-JSON counterparts and drop the JSON suffix. | 988 // TODO(kkania): Replace the non-JSON counterparts and drop the JSON suffix. |
985 void ExecuteJavascriptJSON( | 989 void ExecuteJavascriptJSON( |
986 base::DictionaryValue* args, IPC::Message* reply_message); | 990 base::DictionaryValue* args, IPC::Message* reply_message); |
987 | 991 |
992 // Executes javascript in the specified frame in the login page. Uses the | |
Nirnimesh
2012/04/27 22:46:38
login page -> login page on chromeos
Nirnimesh
2012/04/27 22:46:38
Move to OS_CHROMEOS section below
craigdh
2012/04/27 23:29:50
Done.
craigdh
2012/04/27 23:29:50
Done.
| |
993 // JSON interface. Waits for a result from the |DOMAutomationController|. | |
994 // The javascript must send a string. Must be run before a user has logged in. | |
995 // Example: | |
996 // input: { "frame_xpath": "//frames[1]", | |
997 // "javascript": | |
998 // "window.domAutomationController.send(window.name)", | |
999 // } | |
1000 // output: { "result": "My Window Name" } | |
1001 void ExecuteJavascriptInLogin( | |
1002 base::DictionaryValue* args, IPC::Message* reply_message); | |
1003 | |
988 // Creates a DomEventObserver associated with the AutomationEventQueue. | 1004 // Creates a DomEventObserver associated with the AutomationEventQueue. |
989 // Example: | 1005 // Example: |
990 // input: { "event_name": "login complete", | 1006 // input: { "event_name": "login complete", |
991 // "automation_id": 4444, | 1007 // "automation_id": 4444, |
992 // "recurring": False | 1008 // "recurring": False |
993 // } | 1009 // } |
994 // output: { "observer_id": 1 } | 1010 // output: { "observer_id": 1 } |
995 void AddDomEventObserver( | 1011 void AddDomEventObserver( |
996 base::DictionaryValue* args, IPC::Message* reply_message); | 1012 base::DictionaryValue* args, IPC::Message* reply_message); |
997 | 1013 |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1567 void ResetToDefaultTheme(); | 1583 void ResetToDefaultTheme(); |
1568 | 1584 |
1569 void WaitForProcessLauncherThreadToGoIdle(IPC::Message* reply_message); | 1585 void WaitForProcessLauncherThreadToGoIdle(IPC::Message* reply_message); |
1570 | 1586 |
1571 // Gets the browser that contains the given tab. | 1587 // Gets the browser that contains the given tab. |
1572 void GetParentBrowserOfTab( | 1588 void GetParentBrowserOfTab( |
1573 int tab_handle, int* browser_handle, bool* success); | 1589 int tab_handle, int* browser_handle, bool* success); |
1574 | 1590 |
1575 void OnRemoveProvider(); // Called via PostTask | 1591 void OnRemoveProvider(); // Called via PostTask |
1576 | 1592 |
1593 // Execute Javascript in the context of a specific render view. | |
1594 void ExecuteJavascriptInRenderViewFrame( | |
1595 const string16& frame_xpath, const string16& script, | |
1596 IPC::Message* reply_message, content::RenderViewHost* render_view_host); | |
1597 | |
1577 #if defined(TOOLKIT_VIEWS) | 1598 #if defined(TOOLKIT_VIEWS) |
1578 // Keep track of whether a popup menu has been opened since the last time | 1599 // Keep track of whether a popup menu has been opened since the last time |
1579 // that StartTrackingPopupMenus has been called. | 1600 // that StartTrackingPopupMenus has been called. |
1580 bool popup_menu_opened_; | 1601 bool popup_menu_opened_; |
1581 | 1602 |
1582 // A temporary object that receives a notification when a popup menu opens. | 1603 // A temporary object that receives a notification when a popup menu opens. |
1583 PopupMenuWaiter* popup_menu_waiter_; | 1604 PopupMenuWaiter* popup_menu_waiter_; |
1584 #endif // defined(TOOLKIT_VIEWS) | 1605 #endif // defined(TOOLKIT_VIEWS) |
1585 | 1606 |
1586 #if defined(OS_CHROMEOS) | 1607 #if defined(OS_CHROMEOS) |
(...skipping 14 matching lines...) Expand all Loading... | |
1601 ImportSettingsData import_settings_data_; | 1622 ImportSettingsData import_settings_data_; |
1602 | 1623 |
1603 // The automation event observer queue. It is lazily created when an observer | 1624 // The automation event observer queue. It is lazily created when an observer |
1604 // is added to avoid overhead when not needed. | 1625 // is added to avoid overhead when not needed. |
1605 scoped_ptr<AutomationEventQueue> automation_event_queue_; | 1626 scoped_ptr<AutomationEventQueue> automation_event_queue_; |
1606 | 1627 |
1607 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); | 1628 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); |
1608 }; | 1629 }; |
1609 | 1630 |
1610 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 1631 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
OLD | NEW |