diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 05:34:33 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 05:34:33 +0000 |
commit | 28295ec43b82a3769795399cdf1bcfc47568714d (patch) | |
tree | e0b20f39af9cdc61d94447b2492dabe316d6c184 /chrome | |
parent | 06cd86bc36ed16105e6903130d08de5e5c8c7bf0 (diff) | |
download | chromium_src-28295ec43b82a3769795399cdf1bcfc47568714d.zip chromium_src-28295ec43b82a3769795399cdf1bcfc47568714d.tar.gz chromium_src-28295ec43b82a3769795399cdf1bcfc47568714d.tar.bz2 |
Kill WebViewDelegate::WasOpenedByUserGesture, and instead have
the RenderView implement the logic that was using that method.
R=dglazkov
BUG=24598
TEST=none
Review URL: http://codereview.chromium.org/276059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/render_view.cc | 13 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 1 |
2 files changed, 9 insertions, 5 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 734605a..dce72c2 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -1732,6 +1732,15 @@ void RenderView::show(WebNavigationPolicy policy) { return; did_show_ = true; + // Force new windows to a popup if they were not opened with a user gesture. + if (!opened_by_user_gesture_) { + // We exempt background tabs for compat with older versions of Chrome. + // TODO(darin): This seems bogus. These should have a user gesture, so + // we probably don't need this check. + if (policy != WebKit::WebNavigationPolicyNewBackgroundTab) + policy = WebKit::WebNavigationPolicyNewPopup; + } + // NOTE: initial_pos_ may still have its default values at this point, but // that's okay. It'll be ignored if disposition is not NEW_POPUP, or the // browser process will impose a default position otherwise. @@ -2764,10 +2773,6 @@ void RenderView::OnDeterminePageText() { determine_page_text_after_loading_stops_ = true; } -bool RenderView::WasOpenedByUserGesture() const { - return opened_by_user_gesture_; -} - void RenderView::DnsPrefetch(const std::vector<std::string>& host_names) { Send(new ViewHostMsg_DnsPrefetch(host_names)); } diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index f100778..d0808e9 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -175,7 +175,6 @@ class RenderView : public RenderWidget, WebPluginDelegateProxy* delegate, int status); virtual WebDevToolsAgentDelegate* GetWebDevToolsAgentDelegate(); - virtual bool WasOpenedByUserGesture() const; virtual void UserMetricsRecordAction(const std::wstring& action); virtual void DnsPrefetch(const std::vector<std::string>& host_names); |