diff options
author | twiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 20:29:11 +0000 |
---|---|---|
committer | twiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 20:29:11 +0000 |
commit | e1081d9264ad9e19fe32071b6b99e3dde2d7f122 (patch) | |
tree | e78ff5a19a7316f8e7c8e95322d80100b58c5ffc /chrome_frame/chrome_frame_activex_base.h | |
parent | cadc050d692f83c44da8a386dc37ea57490a9cc9 (diff) | |
download | chromium_src-e1081d9264ad9e19fe32071b6b99e3dde2d7f122.zip chromium_src-e1081d9264ad9e19fe32071b6b99e3dde2d7f122.tar.gz chromium_src-e1081d9264ad9e19fe32071b6b99e3dde2d7f122.tar.bz2 |
Partial clone of the following CL: http://codereview.chromium.org/3013045/show
Differences from the above CL include the following:
- RendererPreferences settings for ExtensionHosts are now extracted from the associated_tab_contents(). This ensures that extension hosts will also forward top level navigation requests.
- Instead of explicitly setting the delegate on the TabContents in ExtensionHost::ShowCreatedWindow, instead I instruct the associated tab-contents to add the newly build tab-contents. Note that this is the exact same behaviour performed by TabContents when initiating a top-level navigation to the host browser.
Points of interest:
- See the TODO in navigation_controller.cc. This problem of an unrecognized navigation entry needs further investigation.
- Also, I found that if the ActiveX control is navigated to a chrome-extension URL, then the top-level-navigation will fail because of the format of the URL. The fix was to construct a temporary url in place of the chrome-extension url.
BUG=51091
TEST=None
Review URL: http://codereview.chromium.org/3357013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59142 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_activex_base.h')
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index 10ad0d9..dae53df 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -511,10 +511,25 @@ END_MSG_MAP() std::wstring wide_url = url_; GURL parsed_url(WideToUTF8(wide_url)); + std::string scheme(parsed_url.scheme()); + std::string host(parsed_url.host()); + + // If Chrome-Frame is presently navigated to an extension page, navigating + // the host to a url with scheme chrome-extension will fail, so we + // point the host at http:local_host. Note that this is NOT the URL + // to which the host is directed. It is only used as a temporary message + // passing mechanism between this CF instance, and the BHO that will + // be constructed in the new IE tab. + if (parsed_url.SchemeIs("chrome-extension") && + is_privileged_) { + scheme = "http"; + host = "local_host"; + } + std::string url = StringPrintf("%hs:%hs?attach_external_tab&%I64u&%d&%d&%d&%d&%d&%hs", - parsed_url.scheme().c_str(), - parsed_url.host().c_str(), + scheme.c_str(), + host.c_str(), params.cookie, params.disposition, params.dimensions.x(), @@ -1221,6 +1236,18 @@ END_MSG_MAP() http_headers.AsInput()); } + void InitializeAutomationSettings() { + static const wchar_t kHandleTopLevelRequests[] = L"HandleTopLevelRequests"; + static const wchar_t kUseChromeNetworking[] = L"UseChromeNetworking"; + + // Query and assign the top-level-request routing, and host networking + // settings from the registry. + bool top_level_requests = GetConfigBool(true, kHandleTopLevelRequests); + bool chrome_network = GetConfigBool(false, kUseChromeNetworking); + automation_client_->set_handle_top_level_requests(top_level_requests); + automation_client_->set_use_chrome_network(chrome_network); + } + ScopedBstr url_; ScopedComPtr<IOleDocumentSite> doc_site_; |