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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 const gfx::Rect& new_bounds) { | 154 const gfx::Rect& new_bounds) { |
155 for (BlockedContents::iterator i(blocked_contents_.begin()); | 155 for (BlockedContents::iterator i(blocked_contents_.begin()); |
156 i != blocked_contents_.end(); ++i) { | 156 i != blocked_contents_.end(); ++i) { |
157 if (i->tab_contents->tab_contents() == source) { | 157 if (i->tab_contents->tab_contents() == source) { |
158 i->bounds = new_bounds; | 158 i->bounds = new_bounds; |
159 break; | 159 break; |
160 } | 160 } |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 bool BlockedContentContainer::IsPopup(const TabContents* source) const { | 164 bool BlockedContentContainer::IsPopupOrPanel(const TabContents* source) const { |
165 // Assume everything added is a popup. This may turn out to be wrong, but | 165 // Assume everything added is a popup. This may turn out to be wrong, but |
166 // callers don't cache this information so it should be fine if the value ends | 166 // callers don't cache this information so it should be fine if the value ends |
167 // up changing. | 167 // up changing. |
168 return true; | 168 return true; |
169 } | 169 } |
170 | 170 |
171 bool BlockedContentContainer::ShouldSuppressDialogs() { | 171 bool BlockedContentContainer::ShouldSuppressDialogs() { |
172 // Suppress JavaScript dialogs when inside a constrained popup window (because | 172 // Suppress JavaScript dialogs when inside a constrained popup window (because |
173 // that activates them and breaks them out of the constrained window jail). | 173 // that activates them and breaks them out of the constrained window jail). |
174 return true; | 174 return true; |
175 } | 175 } |
176 | 176 |
177 TabContentsWrapper* BlockedContentContainer::GetConstrainingContentsWrapper( | 177 TabContentsWrapper* BlockedContentContainer::GetConstrainingContentsWrapper( |
178 TabContentsWrapper* source) { | 178 TabContentsWrapper* source) { |
179 return owner_; | 179 return owner_; |
180 } | 180 } |
OLD | NEW |