| 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> |
| 10 |
| 9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/automation/automation_provider.h" | 13 #include "chrome/browser/automation/automation_provider.h" |
| 14 #include "chrome/browser/automation/automation_provider_json.h" |
| 12 #include "chrome/browser/browser_list.h" | 15 #include "chrome/browser/browser_list.h" |
| 13 #include "chrome/browser/history/history.h" | 16 #include "chrome/browser/history/history.h" |
| 14 #include "chrome/browser/importer/importer_list.h" | 17 #include "chrome/browser/importer/importer_list.h" |
| 15 #include "chrome/browser/sync/profile_sync_service_harness.h" | 18 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 16 #include "content/common/notification_registrar.h" | 19 #include "content/common/notification_registrar.h" |
| 17 #include "content/common/page_type.h" | 20 #include "content/common/page_type.h" |
| 18 | 21 |
| 19 class DictionaryValue; | 22 class DictionaryValue; |
| 20 class TemplateURLModel; | 23 class TemplateURLModel; |
| 21 | 24 |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 void RestoreAllNTPMostVisitedThumbnails(Browser* browser, | 745 void RestoreAllNTPMostVisitedThumbnails(Browser* browser, |
| 743 DictionaryValue* args, | 746 DictionaryValue* args, |
| 744 IPC::Message* reply_message); | 747 IPC::Message* reply_message); |
| 745 | 748 |
| 746 // Kills the given renderer process and returns after the associated | 749 // Kills the given renderer process and returns after the associated |
| 747 // RenderProcessHost receives notification of its closing. | 750 // RenderProcessHost receives notification of its closing. |
| 748 void KillRendererProcess(Browser* browser, | 751 void KillRendererProcess(Browser* browser, |
| 749 DictionaryValue* args, | 752 DictionaryValue* args, |
| 750 IPC::Message* reply_message); | 753 IPC::Message* reply_message); |
| 751 | 754 |
| 752 // Sends a web keyboard event to the active tab. This should not trigger any | 755 // Populates the fields of the event parameters with what is found |
| 753 // browser hotkeys. | 756 // on the args one. If fails return false and puts the error message in |
| 754 // Uses the JSON interface for input/output. | 757 // the error parameter, else returns true. |
| 755 void SendKeyEventToActiveTab(Browser* browser, | 758 bool BuildWebKeyEventFromArgs(DictionaryValue* args, |
| 756 DictionaryValue* args, | 759 std::string* error, |
| 757 IPC::Message* reply_message); | 760 NativeWebKeyboardEvent* event); |
| 758 | 761 |
| 759 // Determines whether each relevant section of the NTP is in thumbnail mode. | 762 // Determines whether each relevant section of the NTP is in thumbnail mode. |
| 760 void GetNTPThumbnailMode(Browser* browser, | 763 void GetNTPThumbnailMode(Browser* browser, |
| 761 DictionaryValue* args, | 764 DictionaryValue* args, |
| 762 IPC::Message* reply_message); | 765 IPC::Message* reply_message); |
| 763 | 766 |
| 764 // Puts or removes the specified section of the NTP into/from thumbnail mode. | 767 // Puts or removes the specified section of the NTP into/from thumbnail mode. |
| 765 // If the section is put into thumbnail mode, all other relevant sections are | 768 // If the section is put into thumbnail mode, all other relevant sections are |
| 766 // removed from thumbnail mode. | 769 // removed from thumbnail mode. |
| 767 void SetNTPThumbnailMode(Browser* browser, | 770 void SetNTPThumbnailMode(Browser* browser, |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 // "windowsKeyCode": ui::VKEY_X, | 983 // "windowsKeyCode": ui::VKEY_X, |
| 981 // "unmodifiedText": "x", | 984 // "unmodifiedText": "x", |
| 982 // "text": "X", | 985 // "text": "X", |
| 983 // "modifiers": automation::kShiftKeyMask, | 986 // "modifiers": automation::kShiftKeyMask, |
| 984 // "isSystemKey": false | 987 // "isSystemKey": false |
| 985 // } | 988 // } |
| 986 // output: none | 989 // output: none |
| 987 void SendWebkitKeyEvent(DictionaryValue* args, | 990 void SendWebkitKeyEvent(DictionaryValue* args, |
| 988 IPC::Message* message); | 991 IPC::Message* message); |
| 989 | 992 |
| 993 // Sends the key event from the OS level to the browser window, |
| 994 // allowing it to be preprocessed by some external application (ie. IME). |
| 995 // Will switch to the tab specified by tab_index before sending the event. |
| 996 // Example: |
| 997 // input: { "windex": 1, |
| 998 // "tab_index": 1, |
| 999 // "keyCode": ui::VKEY_X, |
| 1000 // "modifiers": automation::kShiftKeyMask, |
| 1001 // } |
| 1002 // output: none |
| 1003 void SendOSLevelKeyEventToTab(DictionaryValue* args, |
| 1004 IPC::Message* message); |
| 1005 |
| 1006 // Method used as a Task that sends a success AutomationJSONReply. |
| 1007 void SendSuccessReply(IPC::Message* reply_message); |
| 1008 |
| 990 // Activates the given tab. | 1009 // Activates the given tab. |
| 991 // Example: | 1010 // Example: |
| 992 // input: { "windex": 1, | 1011 // input: { "windex": 1, |
| 993 // "tab_index": 1, | 1012 // "tab_index": 1, |
| 994 // } | 1013 // } |
| 995 // output: none | 1014 // output: none |
| 996 void ActivateTabJSON(DictionaryValue* args, IPC::Message* message); | 1015 void ActivateTabJSON(DictionaryValue* args, IPC::Message* message); |
| 997 | 1016 |
| 998 #if defined(OS_CHROMEOS) | 1017 #if defined(OS_CHROMEOS) |
| 999 void GetLoginInfo(DictionaryValue* args, IPC::Message* reply_message); | 1018 void GetLoginInfo(DictionaryValue* args, IPC::Message* reply_message); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 // Used to enumerate browser profiles. | 1103 // Used to enumerate browser profiles. |
| 1085 scoped_refptr<ImporterList> importer_list_; | 1104 scoped_refptr<ImporterList> importer_list_; |
| 1086 | 1105 |
| 1087 // The stored data for the ImportSettings operation. | 1106 // The stored data for the ImportSettings operation. |
| 1088 ImportSettingsData import_settings_data_; | 1107 ImportSettingsData import_settings_data_; |
| 1089 | 1108 |
| 1090 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); | 1109 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); |
| 1091 }; | 1110 }; |
| 1092 | 1111 |
| 1093 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 1112 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
| OLD | NEW |