| 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/profile.h" | 7 #include "chrome/browser/profile.h" |
| 8 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "chrome/common/pref_service.h" | 10 #include "chrome/common/pref_service.h" |
| 11 #include "chrome/common/notification_service.h" | 11 #include "chrome/common/notification_service.h" |
| 12 | 12 |
| 13 // static | 13 // static |
| 14 const size_t BlockedPopupContainer::kImpossibleNumberOfPopups = 30; |
| 15 |
| 16 // static |
| 14 BlockedPopupContainer* BlockedPopupContainer::Create( | 17 BlockedPopupContainer* BlockedPopupContainer::Create( |
| 15 TabContents* owner, Profile* profile) { | 18 TabContents* owner, Profile* profile) { |
| 16 BlockedPopupContainer* container = | 19 BlockedPopupContainer* container = |
| 17 new BlockedPopupContainer(owner, profile); | 20 new BlockedPopupContainer(owner, profile); |
| 18 BlockedPopupContainerView* view = | 21 BlockedPopupContainerView* view = |
| 19 BlockedPopupContainerView::Create(container); | 22 BlockedPopupContainerView::Create(container); |
| 20 container->set_view(view); | 23 container->set_view(view); |
| 21 return container; | 24 return container; |
| 22 } | 25 } |
| 23 | 26 |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 411 |
| 409 void BlockedPopupContainer::Observe(NotificationType type, | 412 void BlockedPopupContainer::Observe(NotificationType type, |
| 410 const NotificationSource& source, | 413 const NotificationSource& source, |
| 411 const NotificationDetails& details) { | 414 const NotificationDetails& details) { |
| 412 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); | 415 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); |
| 413 TabContents* tab_contents = Source<TabContents>(source).ptr(); | 416 TabContents* tab_contents = Source<TabContents>(source).ptr(); |
| 414 UnblockedPopups::iterator i(unblocked_popups_.find(tab_contents)); | 417 UnblockedPopups::iterator i(unblocked_popups_.find(tab_contents)); |
| 415 DCHECK(i != unblocked_popups_.end()); | 418 DCHECK(i != unblocked_popups_.end()); |
| 416 EraseDataForPopupAndUpdateUI(i); | 419 EraseDataForPopupAndUpdateUI(i); |
| 417 } | 420 } |
| OLD | NEW |