summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-03 23:10:55 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-03 23:10:55 +0000
commite150e821ae4aaeb16ed820724e1ca503de3c5319 (patch)
treec746117e5db6e4dccd9a5a810710d168e997b0db /chrome_frame
parent557e7f8ae443342f60ba537afe00e6eb789e8208 (diff)
downloadchromium_src-e150e821ae4aaeb16ed820724e1ca503de3c5319.zip
chromium_src-e150e821ae4aaeb16ed820724e1ca503de3c5319.tar.gz
chromium_src-e150e821ae4aaeb16ed820724e1ca503de3c5319.tar.bz2
Navigating to a page in ChromeFrame in IE would display the sad tab page briefly until the navigation was initiated from IE.
We have code in the ChromeFrame external tab container to initiate the navigation during initialization if we have a valid url passed in while creating the external tab. The URL would not get passed down even though it was available from ChromeFrame. This fixes bug http://code.google.com/p/chromium/issues/detail?id=43482 Bug=43482 Review URL: http://codereview.chromium.org/2600002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48890 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_active_document.cc9
-rw-r--r--chrome_frame/chrome_frame_activex.cc8
-rw-r--r--chrome_frame/chrome_frame_automation.cc3
-rw-r--r--chrome_frame/chrome_frame_npapi.cc3
-rw-r--r--chrome_frame/chrome_frame_plugin.h10
-rw-r--r--chrome_frame/delete_chrome_history.cc3
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;
}