summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-28 00:50:02 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-28 00:50:02 +0000
commitcd105f8b13e94f56514b0881d8c875fab520b026 (patch)
treeb1e5de706cebb9ffa228b4e0a34d9b9a2e11646c /chrome_frame
parenta3a93e7bbb8275069f319e0807c43f7395502abf (diff)
downloadchromium_src-cd105f8b13e94f56514b0881d8c875fab520b026.zip
chromium_src-cd105f8b13e94f56514b0881d8c875fab520b026.tar.gz
chromium_src-cd105f8b13e94f56514b0881d8c875fab520b026.tar.bz2
Fix ChromeFrame Firefox tests which started failing after the change to allow navigations
from the automation client in the initialized state. The NPAPI implementation attempts to navigate once we initialize Chrome over automation for historical reasons. This results in requesting navigations to the same URL, once when the plugin is initialized and once when the server is launched. Fix is to have a flag which indicates if we received a navigation request before initalization and only navigate in automation server ready notification if yes. TBR=amit Review URL: http://codereview.chromium.org/3281002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_frame_npapi.cc8
-rw-r--r--chrome_frame/chrome_frame_npapi.h3
2 files changed, 9 insertions, 2 deletions
diff --git a/chrome_frame/chrome_frame_npapi.cc b/chrome_frame/chrome_frame_npapi.cc
index e99310e..1ad2c30 100644
--- a/chrome_frame/chrome_frame_npapi.cc
+++ b/chrome_frame/chrome_frame_npapi.cc
@@ -123,7 +123,8 @@ ChromeFrameNPAPI::ChromeFrameNPAPI()
mode_(NP_EMBED),
force_full_page_plugin_(false),
ready_state_(READYSTATE_LOADING),
- enabled_popups_(false) {
+ enabled_popups_(false),
+ navigate_after_initialization_(false) {
}
ChromeFrameNPAPI::~ChromeFrameNPAPI() {
@@ -839,7 +840,8 @@ void ChromeFrameNPAPI::OnAutomationServerReady() {
automation_client_->SetProxySettings(proxy_settings);
}
- if (!src_.empty()) {
+ if (navigate_after_initialization_ && !src_.empty()) {
+ navigate_after_initialization_ = false;
if (!automation_client_->InitiateNavigation(src_,
GetDocumentUrl(),
is_privileged_)) {
@@ -1125,6 +1127,8 @@ bool ChromeFrameNPAPI::NavigateToURL(const NPVariant* args, uint32_t arg_count,
src_.clear();
return false;
}
+ } else {
+ navigate_after_initialization_ = true;
}
return true;
}
diff --git a/chrome_frame/chrome_frame_npapi.h b/chrome_frame/chrome_frame_npapi.h
index 76f1e1e..8fd0c6f7 100644
--- a/chrome_frame/chrome_frame_npapi.h
+++ b/chrome_frame/chrome_frame_npapi.h
@@ -340,6 +340,9 @@ END_MSG_MAP()
std::string src_;
// Used to fetch network resources when host network stack is in use.
NPAPIUrlRequestManager url_fetcher_;
+
+ // Set if we receive a navigation request before initializing Chrome.
+ bool navigate_after_initialization_;
};
#endif // CHROME_FRAME_CHROME_FRAME_NPAPI_H_