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

Side by Side Diff: chrome/browser/blocked_popup_container.cc

Issue 3145001: FBTF: Clean up task.h in x11_util.h and header usage in some delegates. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: more Created 10 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
« no previous file with comments | « chrome/browser/blocked_popup_container.h ('k') | chrome/browser/browser_init_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/blocked_popup_container.h" 5 #include "chrome/browser/blocked_popup_container.h"
6 6
7 #include "chrome/browser/tab_contents/tab_contents.h" 7 #include "chrome/browser/tab_contents/tab_contents.h"
8 #include "gfx/rect.h"
8 9
9 // static 10 // static
10 const size_t BlockedPopupContainer::kImpossibleNumberOfPopups = 30; 11 const size_t BlockedPopupContainer::kImpossibleNumberOfPopups = 30;
11 12
13 struct BlockedPopupContainer::BlockedPopup {
14 BlockedPopup(TabContents* tab_contents,
15 const gfx::Rect& bounds)
16 : tab_contents(tab_contents), bounds(bounds) {
17 }
18
19 TabContents* tab_contents;
20 gfx::Rect bounds;
21 };
22
12 BlockedPopupContainer::BlockedPopupContainer(TabContents* owner) 23 BlockedPopupContainer::BlockedPopupContainer(TabContents* owner)
13 : owner_(owner) { 24 : owner_(owner) {
14 } 25 }
15 26
16 void BlockedPopupContainer::AddTabContents(TabContents* tab_contents, 27 void BlockedPopupContainer::AddTabContents(TabContents* tab_contents,
17 const gfx::Rect& bounds) { 28 const gfx::Rect& bounds) {
18 if (blocked_popups_.size() == (kImpossibleNumberOfPopups - 1)) { 29 if (blocked_popups_.size() == (kImpossibleNumberOfPopups - 1)) {
19 delete tab_contents; 30 delete tab_contents;
20 LOG(INFO) << "Warning: Renderer is sending more popups to us than should " 31 LOG(INFO) << "Warning: Renderer is sending more popups to us than should "
21 "be possible. Renderer compromised?"; 32 "be possible. Renderer compromised?";
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 122 }
112 123
113 bool BlockedPopupContainer::IsPopup(const TabContents* source) const { 124 bool BlockedPopupContainer::IsPopup(const TabContents* source) const {
114 return true; 125 return true;
115 } 126 }
116 127
117 TabContents* BlockedPopupContainer::GetConstrainingContents( 128 TabContents* BlockedPopupContainer::GetConstrainingContents(
118 TabContents* source) { 129 TabContents* source) {
119 return owner_; 130 return owner_;
120 } 131 }
OLDNEW
« no previous file with comments | « chrome/browser/blocked_popup_container.h ('k') | chrome/browser/browser_init_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698