summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/automation_provider.h
diff options
context:
space:
mode:
authorkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 17:52:19 +0000
committerkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 17:52:19 +0000
commit790788ac7de91db6f349a0ecd1c98fd240b73ca2 (patch)
tree7fa4cb0c072c2e9d75b9654284273af55cf8586f /chrome/browser/automation/automation_provider.h
parent86ba6fa82610b38aaf45e3a5497320ddcfb87d79 (diff)
downloadchromium_src-790788ac7de91db6f349a0ecd1c98fd240b73ca2.zip
chromium_src-790788ac7de91db6f349a0ecd1c98fd240b73ca2.tar.gz
chromium_src-790788ac7de91db6f349a0ecd1c98fd240b73ca2.tar.bz2
Add support for basic extension automation through the Automation Proxy.
BUG=36171 TEST=none Review URL: http://codereview.chromium.org/1048002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_provider.h')
-rw-r--r--chrome/browser/automation/automation_provider.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 929bc20..f3d03cb6 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -43,7 +43,10 @@ struct Reposition_Params;
struct ExternalTabSettings;
}
+class AutomationExtensionTracker;
+class Extension;
class ExtensionPortContainer;
+class ExtensionTestResultNotificationObserver;
class ExternalTabContainer;
class LoginHandler;
class MetricEventDurationObserver;
@@ -130,6 +133,11 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
return reply_message;
}
+ // Adds the extension passed in to the extension tracker, and returns
+ // the associated handle. If the tracker already contains the extension,
+ // the handle is simply returned.
+ int AddExtension(Extension* extension);
+
// Adds the external tab passed in to the tab tracker.
bool AddExternalTab(ExternalTabContainer* external_tab);
@@ -381,6 +389,35 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
void GetEnabledExtensions(std::vector<FilePath>* result);
+ void WaitForExtensionTestResult(IPC::Message* reply_message);
+
+ void InstallExtensionAndGetHandle(const FilePath& crx_path,
+ IPC::Message* reply_message);
+
+ void UninstallExtension(int extension_handle,
+ bool* success);
+
+ void ReloadExtension(int extension_handle,
+ IPC::Message* reply_message);
+
+ void EnableExtension(int extension_handle,
+ IPC::Message* reply_message);
+
+ void DisableExtension(int extension_handle,
+ bool* success);
+
+ void ExecuteExtensionActionInActiveTabAsync(int extension_handle,
+ int browser_handle,
+ IPC::Message* reply_message);
+
+ void MoveExtensionBrowserAction(int extension_handle, int index,
+ bool* success);
+
+ void GetExtensionProperty(int extension_handle,
+ AutomationMsg_ExtensionProperty type,
+ bool* success,
+ std::string* value);
+
void NavigateInExternalTab(
int handle, const GURL& url, const GURL& referrer,
AutomationMsg_NavigationResponseValues* status);
@@ -595,6 +632,18 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
// Returns NULL on failure.
RenderViewHost* GetViewForTab(int tab_handle);
+ // Returns the extension for the given handle. Returns NULL if there is
+ // no extension for the handle.
+ Extension* GetExtension(int extension_handle);
+
+ // Returns the extension for the given handle, if the handle is valid and
+ // the associated extension is enabled. Returns NULL otherwise.
+ Extension* GetEnabledExtension(int extension_handle);
+
+ // Returns the extension for the given handle, if the handle is valid and
+ // the associated extension is disabled. Returns NULL otherwise.
+ Extension* GetDisabledExtension(int extension_handle);
+
// Block until the focused view ID changes to something other than
// previous_view_id.
void WaitForFocusedViewIDToChange(int handle,
@@ -621,8 +670,11 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
scoped_ptr<NotificationObserver> find_in_page_observer_;
scoped_ptr<NotificationObserver> dom_operation_observer_;
scoped_ptr<NotificationObserver> dom_inspector_observer_;
+ scoped_ptr<ExtensionTestResultNotificationObserver>
+ extension_test_result_observer_;
scoped_ptr<MetricEventDurationObserver> metric_event_duration_observer_;
scoped_ptr<AutomationBrowserTracker> browser_tracker_;
+ scoped_ptr<AutomationExtensionTracker> extension_tracker_;
scoped_ptr<AutomationTabTracker> tab_tracker_;
scoped_ptr<AutomationWindowTracker> window_tracker_;
scoped_ptr<AutomationAutocompleteEditTracker> autocomplete_edit_tracker_;