Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: chrome/renderer/render_view.cc

Issue 276059: Kill WebViewDelegate::WasOpenedByUserGesture, and instead have... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/chrome_client_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 29244)
+++ chrome/renderer/render_view.cc (working copy)
@@ -1732,6 +1732,15 @@
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 @@
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));
}
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/chrome_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698