| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/content_settings/popup_blocked_infobar_deleg
ate.h" | 5 #include "chrome/browser/ui/android/content_settings/popup_blocked_infobar_deleg
ate.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 9 #include "chrome/browser/infobars/infobar.h" | 9 #include "chrome/browser/infobars/infobar.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool PopupBlockedInfoBarDelegate::Accept() { | 94 bool PopupBlockedInfoBarDelegate::Accept() { |
| 95 DCHECK(can_show_popups_); | 95 DCHECK(can_show_popups_); |
| 96 | 96 |
| 97 // Create exceptions. | 97 // Create exceptions. |
| 98 map_->AddExceptionForURL( | 98 map_->AddExceptionForURL( |
| 99 url_, url_, CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW); | 99 url_, url_, CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW); |
| 100 | 100 |
| 101 // Launch popups. | 101 // Launch popups. |
| 102 content::WebContents* web_contents = |
| 103 InfoBarService::WebContentsFromInfoBar(infobar()); |
| 102 PopupBlockerTabHelper* popup_blocker_helper = | 104 PopupBlockerTabHelper* popup_blocker_helper = |
| 103 PopupBlockerTabHelper::FromWebContents(web_contents()); | 105 PopupBlockerTabHelper::FromWebContents(web_contents); |
| 104 DCHECK(popup_blocker_helper); | 106 DCHECK(popup_blocker_helper); |
| 105 PopupBlockerTabHelper::PopupIdMap blocked_popups = | 107 PopupBlockerTabHelper::PopupIdMap blocked_popups = |
| 106 popup_blocker_helper->GetBlockedPopupRequests(); | 108 popup_blocker_helper->GetBlockedPopupRequests(); |
| 107 for (PopupBlockerTabHelper::PopupIdMap::iterator it = blocked_popups.begin(); | 109 for (PopupBlockerTabHelper::PopupIdMap::iterator it = blocked_popups.begin(); |
| 108 it != blocked_popups.end(); ++it) | 110 it != blocked_popups.end(); ++it) |
| 109 popup_blocker_helper->ShowBlockedPopup(it->first); | 111 popup_blocker_helper->ShowBlockedPopup(it->first); |
| 110 | 112 |
| 111 return true; | 113 return true; |
| 112 } | 114 } |
| 113 | 115 |
| OLD | NEW |