| 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/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 i != blocked_contents_.end(); ++i) { | 67 i != blocked_contents_.end(); ++i) { |
| 68 if (i->tab_contents == tab_contents) { | 68 if (i->tab_contents == tab_contents) { |
| 69 // To support the owner blocking the content again we copy and erase | 69 // To support the owner blocking the content again we copy and erase |
| 70 // before attempting to add. | 70 // before attempting to add. |
| 71 BlockedContent content(*i); | 71 BlockedContent content(*i); |
| 72 blocked_contents_.erase(i); | 72 blocked_contents_.erase(i); |
| 73 i = blocked_contents_.end(); | 73 i = blocked_contents_.end(); |
| 74 tab_contents->web_contents()->SetDelegate(NULL); | 74 tab_contents->web_contents()->SetDelegate(NULL); |
| 75 tab_contents->blocked_content_tab_helper()->set_delegate(NULL); | 75 tab_contents->blocked_content_tab_helper()->set_delegate(NULL); |
| 76 // We needn't call WasRestored to change its status because the | 76 // We needn't call WasRestored to change its status because the |
| 77 // TabContents::AddNewContents will do it. | 77 // WebContents::AddNewContents will do it. |
| 78 owner_->web_contents()->AddNewContents( | 78 owner_->web_contents()->AddNewContents( |
| 79 tab_contents->web_contents(), | 79 tab_contents->web_contents(), |
| 80 content.disposition, | 80 content.disposition, |
| 81 content.bounds, | 81 content.bounds, |
| 82 content.user_gesture); | 82 content.user_gesture); |
| 83 break; | 83 break; |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 bool BlockedContentContainer::ShouldSuppressDialogs() { | 160 bool BlockedContentContainer::ShouldSuppressDialogs() { |
| 161 // Suppress JavaScript dialogs when inside a constrained popup window (because | 161 // Suppress JavaScript dialogs when inside a constrained popup window (because |
| 162 // that activates them and breaks them out of the constrained window jail). | 162 // that activates them and breaks them out of the constrained window jail). |
| 163 return true; | 163 return true; |
| 164 } | 164 } |
| 165 | 165 |
| 166 TabContentsWrapper* BlockedContentContainer::GetConstrainingContentsWrapper( | 166 TabContentsWrapper* BlockedContentContainer::GetConstrainingContentsWrapper( |
| 167 TabContentsWrapper* source) { | 167 TabContentsWrapper* source) { |
| 168 return owner_; | 168 return owner_; |
| 169 } | 169 } |
| OLD | NEW |