OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/blocked_content/blocked_content_container.h" | 5 #include "chrome/browser/ui/blocked_content/blocked_content_container.h" |
6 | 6 |
7 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 7 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
9 #include "content/browser/tab_contents/tab_contents.h" | 9 #include "content/browser/tab_contents/tab_contents.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 bool BlockedContentContainer::IsPopup(const TabContents* source) const { | 159 bool BlockedContentContainer::IsPopup(const TabContents* source) const { |
160 // Assume everything added is a popup. This may turn out to be wrong, but | 160 // Assume everything added is a popup. This may turn out to be wrong, but |
161 // callers don't cache this information so it should be fine if the value ends | 161 // callers don't cache this information so it should be fine if the value ends |
162 // up changing. | 162 // up changing. |
163 return true; | 163 return true; |
164 } | 164 } |
165 | 165 |
| 166 bool BlockedContentContainer::ShouldSuppressDialogs() { |
| 167 // Suppress JavaScript dialogs when inside a constrained popup window (because |
| 168 // that activates them and breaks them out of the constrained window jail). |
| 169 return true; |
| 170 } |
| 171 |
166 TabContents* BlockedContentContainer::GetConstrainingContents( | 172 TabContents* BlockedContentContainer::GetConstrainingContents( |
167 TabContents* source) { | 173 TabContents* source) { |
168 return owner_->tab_contents(); | 174 return owner_->tab_contents(); |
169 } | 175 } |
170 | 176 |
171 TabContentsWrapper* BlockedContentContainer::GetConstrainingContentsWrapper( | 177 TabContentsWrapper* BlockedContentContainer::GetConstrainingContentsWrapper( |
172 TabContentsWrapper* source) { | 178 TabContentsWrapper* source) { |
173 return owner_; | 179 return owner_; |
174 } | 180 } |
OLD | NEW |