summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-08 14:02:58 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-08 14:02:58 +0000
commit4cfc1d9243eaf01a3b736fa13f55b7400a891fb4 (patch)
tree8f8da34f968fdf547aefc55b3f5d9e210b1a03b3 /chrome_frame
parentbb76183f666753f186e5234ddea409971753c784 (diff)
downloadchromium_src-4cfc1d9243eaf01a3b736fa13f55b7400a891fb4.zip
chromium_src-4cfc1d9243eaf01a3b736fa13f55b7400a891fb4.tar.gz
chromium_src-4cfc1d9243eaf01a3b736fa13f55b7400a891fb4.tar.bz2
Modifying extension automation so that it is done through a particular
tab for all extension views. Previously, API routing to the automation client would only work for extension views that were contained in the particular ExternalTab instance being automated. This meant you couldn't test API calls from e.g. background pages. Also using async functions instead of the previous RVH-based hack. Updating one of the UI tests to make the API calls from a background page, to provide an end-to-end test of the new routing. This makes AutomationProvider::SetEnableAutomationExtension Windows-only, but it effectively always was since it was already dependent on ExternalTabContainer (indirectly, to provide a non-empty implementation of TabContentsDelegate::ForwardMessageToExternalHost). BUG=none TEST=ui_tests.exe, chrome_frame_tests.exe, chrome_frame_unittests.exe Review URL: http://codereview.chromium.org/366025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31403 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_frame_automation.cc8
-rw-r--r--chrome_frame/chrome_frame_automation.h7
2 files changed, 7 insertions, 8 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index 6b9acb8..54e114d 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -755,7 +755,13 @@ void ChromeFrameAutomationClient::SetEnableExtensionAutomation(
if (!is_initialized())
return;
- automation_server_->SetEnableExtensionAutomation(functions_enabled);
+ // We are doing initialization, so there is no need to reset extension
+ // automation, only to set it. Also, we want to avoid resetting extension
+ // automation that some other automation client has set up. Therefore only
+ // send the message if we are going to enable automation of some functions.
+ if (functions_enabled.size() > 0) {
+ tab_->SetEnableExtensionAutomation(functions_enabled);
+ }
}
// Invoked in launch background thread.
diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h
index 9d948a3..8def0fd 100644
--- a/chrome_frame/chrome_frame_automation.h
+++ b/chrome_frame/chrome_frame_automation.h
@@ -41,8 +41,6 @@ struct DECLSPEC_NOVTABLE ChromeFrameAutomationProxy {
virtual std::string server_version() = 0;
virtual void SendProxyConfig(const std::string&) = 0;
- virtual void SetEnableExtensionAutomation(
- const std::vector<std::string>& functions_enabled) = 0;
protected:
~ChromeFrameAutomationProxy() {}
};
@@ -73,11 +71,6 @@ class ChromeFrameAutomationProxyImpl : public ChromeFrameAutomationProxy,
AutomationProxy::SendProxyConfig(p);
}
- virtual void SetEnableExtensionAutomation(
- const std::vector<std::string>& functions_enabled) {
- AutomationProxy::SetEnableExtensionAutomation(functions_enabled);
- }
-
protected:
explicit ChromeFrameAutomationProxyImpl(int launch_timeout);
~ChromeFrameAutomationProxyImpl();