diff options
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 9 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_activex.cc | 8 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 3 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_npapi.cc | 3 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_plugin.h | 10 | ||||
-rw-r--r-- | chrome_frame/delete_chrome_history.cc | 3 |
6 files changed, 25 insertions, 11 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index 1055b43..afe62e8 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -961,6 +961,9 @@ bool ChromeActiveDocument::LaunchUrl(const std::wstring& url, url_.Allocate(url.c_str()); + std::string referrer; + std::string utf8_url; + if (!is_new_navigation) { WStringTokenizer tokenizer(url, L"&"); // Skip over kChromeAttachExternalTabPrefix @@ -982,10 +985,8 @@ bool ChromeActiveDocument::LaunchUrl(const std::wstring& url, // Initiate navigation before launching chrome so that the url will be // cached and sent with launch settings. if (url_.Length()) { - std::string utf8_url; WideToUTF8(url_, url_.Length(), &utf8_url); - std::string referrer; NavigationManager* mgr = NavigationManager::GetThreadInstance(); if (mgr) referrer = mgr->referrer(); @@ -1008,8 +1009,8 @@ bool ChromeActiveDocument::LaunchUrl(const std::wstring& url, automation_client_->SetUrlFetcher(&url_fetcher_); - return InitializeAutomation(GetHostProcessName(false), std::wstring(), - IsIEInPrivate(), false); + return InitializeAutomation(GetHostProcessName(false), L"", IsIEInPrivate(), + false, GURL(utf8_url), GURL(referrer)); } diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc index bd6b937..3803fad 100644 --- a/chrome_frame/chrome_frame_activex.cc +++ b/chrome_frame/chrome_frame_activex.cc @@ -452,10 +452,16 @@ HRESULT ChromeFrameActivex::IOleObject_SetClientSite( profile_name.assign(profile_name_arg, profile_name_arg.Length()); } + std::string utf8_url; + if (url_.Length()) { + WideToUTF8(url_, url_.Length(), &utf8_url); + } + url_fetcher_.set_frame_busting(!is_privileged_); automation_client_->SetUrlFetcher(&url_fetcher_); if (!InitializeAutomation(profile_name, chrome_extra_arguments, - IsIEInPrivate(), true)) { + IsIEInPrivate(), true, GURL(utf8_url), + GURL())) { return E_FAIL; } } diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 9f58181..0b62298 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -515,6 +515,9 @@ bool ChromeFrameAutomationClient::Initialize( // InitializeComplete is called successfully. init_state_ = INITIALIZING; + if (chrome_launch_params_.url.is_valid()) + navigate_after_initialization_ = false; + if (!navigate_after_initialization_) { chrome_launch_params_.url = url_; } diff --git a/chrome_frame/chrome_frame_npapi.cc b/chrome_frame/chrome_frame_npapi.cc index f6a0174..241a0ef 100644 --- a/chrome_frame/chrome_frame_npapi.cc +++ b/chrome_frame/chrome_frame_npapi.cc @@ -272,7 +272,8 @@ bool ChromeFrameNPAPI::Initialize(NPMIMEType mime_type, NPP instance, // TODO(stoyan): Ask host for specific interface whether to honor // host's in-private mode. return InitializeAutomation(profile_name, extra_arguments, - GetBrowserIncognitoMode(), true); + GetBrowserIncognitoMode(), true, + GURL(src_), GURL()); } void ChromeFrameNPAPI::Uninitialize() { diff --git a/chrome_frame/chrome_frame_plugin.h b/chrome_frame/chrome_frame_plugin.h index 85d83dc..93461df 100644 --- a/chrome_frame/chrome_frame_plugin.h +++ b/chrome_frame/chrome_frame_plugin.h @@ -58,7 +58,8 @@ END_MSG_MAP() bool InitializeAutomation(const std::wstring& profile_name, const std::wstring& extra_chrome_arguments, - bool incognito, bool is_widget_mode) { + bool incognito, bool is_widget_mode, + const GURL& url, const GURL& referrer) { DCHECK(IsValid()); // We don't want to do incognito when privileged, since we're // running in browser chrome or some other privileged context. @@ -67,8 +68,8 @@ END_MSG_MAP() GetProfilePath(profile_name, &profile_path); ChromeFrameLaunchParams chrome_launch_params = { kCommandExecutionTimeout, - GURL(), - GURL(), + url, + referrer, profile_path, profile_name, extra_chrome_arguments, @@ -206,7 +207,8 @@ END_MSG_MAP() // Return true if menu command is processed, otherwise the command will be // passed to Chrome for execution. Override in most-derived class if needed. - bool HandleContextMenuCommand(UINT cmd, const IPC::ContextMenuParams& params) { + bool HandleContextMenuCommand(UINT cmd, + const IPC::ContextMenuParams& params) { return false; } diff --git a/chrome_frame/delete_chrome_history.cc b/chrome_frame/delete_chrome_history.cc index 26633f0..1b4b7b9 100644 --- a/chrome_frame/delete_chrome_history.cc +++ b/chrome_frame/delete_chrome_history.cc @@ -57,7 +57,8 @@ STDMETHODIMP DeleteChromeHistory::DeleteBrowsingHistory(DWORD flags) { // in lieu of sending an IPC when it seems appropriate. Since we assume this // happens in one-off fashion, don't attempt to pack REMOVE_* arguments. // Instead, have the browser process clobber all history. - if (!InitializeAutomation(GetHostProcessName(false), L"", false, false)) { + if (!InitializeAutomation(GetHostProcessName(false), L"", false, false, + GURL(), GURL())) { return E_UNEXPECTED; } |