| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // 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/extensions/extension_function_dispatcher.h" | |
| 8 #include "chrome/browser/profile.h" | 7 #include "chrome/browser/profile.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 11 #include "chrome/common/pref_service.h" | 10 #include "chrome/common/pref_service.h" |
| 12 #include "chrome/common/notification_service.h" | 11 #include "chrome/common/notification_service.h" |
| 13 | 12 |
| 14 // static | 13 // static |
| 15 BlockedPopupContainer* BlockedPopupContainer::Create( | 14 BlockedPopupContainer* BlockedPopupContainer::Create( |
| 16 TabContents* owner, Profile* profile) { | 15 TabContents* owner, Profile* profile) { |
| 17 BlockedPopupContainer* container = | 16 BlockedPopupContainer* container = |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 235 |
| 237 bool BlockedPopupContainer::IsPopup(TabContents* source) { | 236 bool BlockedPopupContainer::IsPopup(TabContents* source) { |
| 238 return true; | 237 return true; |
| 239 } | 238 } |
| 240 | 239 |
| 241 TabContents* BlockedPopupContainer::GetConstrainingContents( | 240 TabContents* BlockedPopupContainer::GetConstrainingContents( |
| 242 TabContents* source) { | 241 TabContents* source) { |
| 243 return owner_; | 242 return owner_; |
| 244 } | 243 } |
| 245 | 244 |
| 246 ExtensionFunctionDispatcher* BlockedPopupContainer:: | |
| 247 CreateExtensionFunctionDispatcher(RenderViewHost* render_view_host, | |
| 248 const std::string& extension_id) { | |
| 249 return new ExtensionFunctionDispatcher(render_view_host, NULL, extension_id); | |
| 250 } | |
| 251 | |
| 252 void BlockedPopupContainer::HideSelf() { | 245 void BlockedPopupContainer::HideSelf() { |
| 253 view_->HideView(); | 246 view_->HideView(); |
| 254 owner_->PopupNotificationVisibilityChanged(false); | 247 owner_->PopupNotificationVisibilityChanged(false); |
| 255 } | 248 } |
| 256 | 249 |
| 257 void BlockedPopupContainer::ClearData() { | 250 void BlockedPopupContainer::ClearData() { |
| 258 for (BlockedPopups::iterator i(blocked_popups_.begin()); | 251 for (BlockedPopups::iterator i(blocked_popups_.begin()); |
| 259 i != blocked_popups_.end(); ++i) { | 252 i != blocked_popups_.end(); ++i) { |
| 260 TabContents* tab_contents = i->tab_contents; | 253 TabContents* tab_contents = i->tab_contents; |
| 261 tab_contents->set_delegate(NULL); | 254 tab_contents->set_delegate(NULL); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 371 |
| 379 void BlockedPopupContainer::Observe(NotificationType type, | 372 void BlockedPopupContainer::Observe(NotificationType type, |
| 380 const NotificationSource& source, | 373 const NotificationSource& source, |
| 381 const NotificationDetails& details) { | 374 const NotificationDetails& details) { |
| 382 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); | 375 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); |
| 383 TabContents* tab_contents = Source<TabContents>(source).ptr(); | 376 TabContents* tab_contents = Source<TabContents>(source).ptr(); |
| 384 UnblockedPopups::iterator i(unblocked_popups_.find(tab_contents)); | 377 UnblockedPopups::iterator i(unblocked_popups_.find(tab_contents)); |
| 385 DCHECK(i != unblocked_popups_.end()); | 378 DCHECK(i != unblocked_popups_.end()); |
| 386 EraseDataForPopupAndUpdateUI(i); | 379 EraseDataForPopupAndUpdateUI(i); |
| 387 } | 380 } |
| OLD | NEW |