| OLD | NEW |
| 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_content_container.h" | 5 #include "chrome/browser/blocked_content_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 #include "gfx/rect.h" |
| 9 | 9 |
| 10 // static | 10 // static |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 TabContents* tab_contents; | 24 TabContents* tab_contents; |
| 25 WindowOpenDisposition disposition; | 25 WindowOpenDisposition disposition; |
| 26 gfx::Rect bounds; | 26 gfx::Rect bounds; |
| 27 bool user_gesture; | 27 bool user_gesture; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 BlockedContentContainer::BlockedContentContainer(TabContents* owner) | 30 BlockedContentContainer::BlockedContentContainer(TabContents* owner) |
| 31 : owner_(owner) { | 31 : owner_(owner) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 BlockedContentContainer::~BlockedContentContainer() {} |
| 35 |
| 34 void BlockedContentContainer::AddTabContents(TabContents* tab_contents, | 36 void BlockedContentContainer::AddTabContents(TabContents* tab_contents, |
| 35 WindowOpenDisposition disposition, | 37 WindowOpenDisposition disposition, |
| 36 const gfx::Rect& bounds, | 38 const gfx::Rect& bounds, |
| 37 bool user_gesture) { | 39 bool user_gesture) { |
| 38 if (blocked_contents_.size() == (kImpossibleNumberOfPopups - 1)) { | 40 if (blocked_contents_.size() == (kImpossibleNumberOfPopups - 1)) { |
| 39 delete tab_contents; | 41 delete tab_contents; |
| 40 LOG(INFO) << "Warning: Renderer is sending more popups to us than should " | 42 LOG(INFO) << "Warning: Renderer is sending more popups to us than should " |
| 41 "be possible. Renderer compromised?"; | 43 "be possible. Renderer compromised?"; |
| 42 return; | 44 return; |
| 43 } | 45 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Assume everything added is a popup. This may turn out to be wrong, but | 142 // Assume everything added is a popup. This may turn out to be wrong, but |
| 141 // callers don't cache this information so it should be fine if the value ends | 143 // callers don't cache this information so it should be fine if the value ends |
| 142 // up changing. | 144 // up changing. |
| 143 return true; | 145 return true; |
| 144 } | 146 } |
| 145 | 147 |
| 146 TabContents* BlockedContentContainer::GetConstrainingContents( | 148 TabContents* BlockedContentContainer::GetConstrainingContents( |
| 147 TabContents* source) { | 149 TabContents* source) { |
| 148 return owner_; | 150 return owner_; |
| 149 } | 151 } |
| OLD | NEW |