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

Side by Side Diff: chrome/browser/ui/browser_tabstrip.cc

Issue 20209004: Turn on better popup blocker by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser_tabstrip.h" 5 #include "chrome/browser/ui/browser_tabstrip.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" 9 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (was_blocked) 70 if (was_blocked)
71 *was_blocked = true; 71 *was_blocked = true;
72 return; 72 return;
73 } 73 }
74 74
75 // Handle blocking of popups. 75 // Handle blocking of popups.
76 if ((disposition == NEW_POPUP || disposition == NEW_FOREGROUND_TAB || 76 if ((disposition == NEW_POPUP || disposition == NEW_FOREGROUND_TAB ||
77 disposition == NEW_BACKGROUND_TAB) && !user_gesture && 77 disposition == NEW_BACKGROUND_TAB) && !user_gesture &&
78 !CommandLine::ForCurrentProcess()->HasSwitch( 78 !CommandLine::ForCurrentProcess()->HasSwitch(
79 switches::kDisablePopupBlocking) && 79 switches::kDisablePopupBlocking) &&
80 !CommandLine::ForCurrentProcess()->HasSwitch( 80 CommandLine::ForCurrentProcess()->HasSwitch(
81 switches::kEnableBetterPopupBlocking)) { 81 switches::kDisableBetterPopupBlocking)) {
82 // Unrequested popups from normal pages are constrained unless they're in 82 // Unrequested popups from normal pages are constrained unless they're in
83 // the white list. The popup owner will handle checking this. 83 // the white list. The popup owner will handle checking this.
84 source_blocked_content->AddPopup( 84 source_blocked_content->AddPopup(
85 new_contents, disposition, initial_pos, user_gesture); 85 new_contents, disposition, initial_pos, user_gesture);
86 if (was_blocked) 86 if (was_blocked)
87 *was_blocked = true; 87 *was_blocked = true;
88 return; 88 return;
89 } 89 }
90 90
91 new_contents->GetRenderViewHost()->DisassociateFromPopupCount(); 91 new_contents->GetRenderViewHost()->DisassociateFromPopupCount();
(...skipping 17 matching lines...) Expand all
109 return; 109 return;
110 } 110 }
111 111
112 browser->tab_strip_model()->CloseWebContentsAt( 112 browser->tab_strip_model()->CloseWebContentsAt(
113 index, 113 index,
114 add_to_history ? TabStripModel::CLOSE_CREATE_HISTORICAL_TAB 114 add_to_history ? TabStripModel::CLOSE_CREATE_HISTORICAL_TAB
115 : TabStripModel::CLOSE_NONE); 115 : TabStripModel::CLOSE_NONE);
116 } 116 }
117 117
118 } // namespace chrome 118 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698