diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-18 21:07:53 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-18 21:07:53 +0000 |
commit | 7de487c60478205f8f4396d2b77dd4e0fd65f583 (patch) | |
tree | ea02cb62f1edde2791ca2c090dc3eeef55b4e395 /chrome_frame/chrome_frame_automation.h | |
parent | 3ec54a2fe0482dc97113478ac87e45b505e636be (diff) | |
download | chromium_src-7de487c60478205f8f4396d2b77dd4e0fd65f583.zip chromium_src-7de487c60478205f8f4396d2b77dd4e0fd65f583.tar.gz chromium_src-7de487c60478205f8f4396d2b77dd4e0fd65f583.tar.bz2 |
Multiple chrome frame activex controls should instantiate and navigate correctly in IE. This was not
the case due to a race condition between put_src getting called for subsequent activex instances
and the external tab to hold the chrome frame instance getting created.
Fix is to pass in the URL if we have it when the automation client is initialized to launch the chrome
automation server. If not we navigate when the external tab is created. To achieve this we stuff in
all relevant parameters into a structure which is populated when the automation client is initialized.
I also changed the CreateExternalTab message to carry the referrer for the initial navigation.
Fixes http://code.google.com/p/chromium/issues/detail?id=28236
Test=added unit tests for the same. The firefox one is not working at this point. Disabled this test
for now while I debug it.
Bug=28236
Review URL: http://codereview.chromium.org/500123
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34985 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_automation.h')
-rw-r--r-- | chrome_frame/chrome_frame_automation.h | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h index 90c1951..aa62948 100644 --- a/chrome_frame/chrome_frame_automation.h +++ b/chrome_frame/chrome_frame_automation.h @@ -79,6 +79,17 @@ class ChromeFrameAutomationProxyImpl : public ChromeFrameAutomationProxy, friend class ProxyFactory; }; +// This structure contains information used for launching chrome. +struct ChromeFrameLaunchParams { + int automation_server_launch_timeout; + GURL url; + GURL referrer; + std::wstring profile_name; + std::wstring extra_chrome_arguments; + bool perform_version_check; + bool incognito_mode; +}; + // We must create and destroy automation proxy in a thread with a message loop. // Hence thread cannot be a member of the proxy. class ProxyFactory { @@ -92,14 +103,10 @@ class ProxyFactory { ProxyFactory(); ~ProxyFactory(); - // FIXME: we should pass the result as output parameter, not as return value - // since, LaunchDelegate can be invoked before this function returns. - virtual void* GetAutomationServer(int launch_timeout, - const std::wstring& profile_name, - // Extra command line argument when launching Chrome - const std::wstring& extra_argument, - bool perform_version_check, - LaunchDelegate* delegate); + + virtual void GetAutomationServer(LaunchDelegate* delegate, + const ChromeFrameLaunchParams& params, + void** automation_server_id); virtual bool ReleaseAutomationServer(void* server_id); private: @@ -113,9 +120,7 @@ class ProxyFactory { }; void CreateProxy(ProxyCacheEntry* entry, - int launch_timeout, - const std::wstring& extra_chrome_arguments, - bool perform_version_check, + const ChromeFrameLaunchParams& params, LaunchDelegate* delegate); void DestroyProxy(ProxyCacheEntry* entry); @@ -300,7 +305,6 @@ class ChromeFrameAutomationClient return init_state_ == INITIALIZED; } - bool incognito_; HWND parent_window_; PlatformThreadId ui_thread_id_; @@ -310,6 +314,7 @@ class ChromeFrameAutomationClient scoped_refptr<TabProxy> tab_; ChromeFrameDelegate* chrome_frame_delegate_; GURL url_; + GURL referrer_; // Handle to the underlying chrome window. This is a child of the external // tab window. @@ -335,6 +340,12 @@ class ChromeFrameAutomationClient int tab_handle_; // Only used if we attach to an existing tab. intptr_t external_tab_cookie_; + + // Set to true if we received a navigation request prior to the automation + // server being initialized. + bool navigate_after_initialization_; + + ChromeFrameLaunchParams chrome_launch_params_; }; #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ |