summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-29 16:26:43 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-29 16:26:43 +0000
commitc306d4da6b52ae27d7fae37a077808d67e762a93 (patch)
tree296aaa10c4eb40e7b3b193c933af84217bfe3931 /chrome/renderer
parent66de39d1e2b87105dc31d493060aa1a9d79c1c44 (diff)
downloadchromium_src-c306d4da6b52ae27d7fae37a077808d67e762a93.zip
chromium_src-c306d4da6b52ae27d7fae37a077808d67e762a93.tar.gz
chromium_src-c306d4da6b52ae27d7fae37a077808d67e762a93.tar.bz2
Instead of passing down a switch to the renderer, storing a member, etc., just implement --disable-popup-blocking in the browser at the point where we make the final policy decision.
Review URL: http://codereview.chromium.org/100132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_view.cc19
-rw-r--r--chrome/renderer/render_view.h6
2 files changed, 2 insertions, 23 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 0f085dc..174408e 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -196,7 +196,6 @@ RenderView::RenderView(RenderThreadBase* render_thread)
devtools_client_(NULL),
history_back_list_count_(0),
history_forward_list_count_(0),
- disable_popup_blocking_(false),
has_unload_listener_(false),
decrement_shared_popup_at_destruction_(false),
form_field_autofill_request_id_(0),
@@ -328,8 +327,6 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd,
if (command_line.HasSwitch(switches::kDomAutomationController))
enabled_bindings_ |= BindingsPolicy::DOM_AUTOMATION;
- disable_popup_blocking_ =
- command_line.HasSwitch(switches::kDisablePopupBlocking);
debug_message_handler_ = new DebugMessageHandler(this);
render_thread_->AddFilter(debug_message_handler_);
@@ -1960,9 +1957,8 @@ void RenderView::Show(WebWidget* webwidget, WindowOpenDisposition disposition) {
// 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.
- Send(new ViewHostMsg_ShowView(
- opener_id_, routing_id_, disposition, initial_pos_,
- WasOpenedByUserGestureHelper()));
+ Send(new ViewHostMsg_ShowView(opener_id_, routing_id_, disposition,
+ initial_pos_, WasOpenedByUserGesture(NULL)));
}
void RenderView::CloseWidgetSoon(WebWidget* webwidget) {
@@ -2293,17 +2289,6 @@ void RenderView::ReportFindInPageSelection(int request_id,
}
bool RenderView::WasOpenedByUserGesture(WebView* webview) const {
- return WasOpenedByUserGestureHelper();
-}
-
-bool RenderView::WasOpenedByUserGestureHelper() const {
- // If pop-up blocking has been disabled, then treat all new windows as if
- // they were opened by a user gesture. This will prevent them from being
- // blocked. This is a bit of a hack, there should be a more straightforward
- // way to disable pop-up blocking.
- if (disable_popup_blocking_)
- return true;
-
return opened_by_user_gesture_;
}
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 278fc7b..6db3a077 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -619,9 +619,6 @@ class RenderView : public RenderWidget,
// Decodes a data: URL image or returns an empty image in case of failure.
SkBitmap ImageFromDataUrl(const GURL&) const;
- // A helper method used by WasOpenedByUserGesture.
- bool WasOpenedByUserGestureHelper() const;
-
void DumpLoadHistograms() const;
// Bitwise-ORed set of extra bindings that have been enabled. See
@@ -741,9 +738,6 @@ class RenderView : public RenderWidget,
int history_back_list_count_;
int history_forward_list_count_;
- // True if pop-up blocking is disabled. False by default.
- bool disable_popup_blocking_;
-
// True if the page has any frame-level unload or beforeunload listeners.
bool has_unload_listener_;