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 <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/prefs/pref_service.h" | |
11 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
12 #include "chrome/browser/infobars/infobar_service.h" | 11 #include "chrome/browser/infobars/infobar_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 13 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
15 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
16 #include "components/content_settings/core/browser/host_content_settings_map.h" | 15 #include "components/content_settings/core/browser/host_content_settings_map.h" |
17 #include "components/content_settings/core/common/content_settings.h" | 16 #include "components/content_settings/core/common/content_settings.h" |
18 #include "components/content_settings/core/common/content_settings_types.h" | 17 #include "components/content_settings/core/common/content_settings_types.h" |
19 #include "components/infobars/core/infobar.h" | 18 #include "components/infobars/core/infobar.h" |
| 19 #include "components/prefs/pref_service.h" |
20 #include "grit/theme_resources.h" | 20 #include "grit/theme_resources.h" |
21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
22 | 22 |
23 | 23 |
24 // static | 24 // static |
25 void PopupBlockedInfoBarDelegate::Create(content::WebContents* web_contents, | 25 void PopupBlockedInfoBarDelegate::Create(content::WebContents* web_contents, |
26 int num_popups) { | 26 int num_popups) { |
27 const GURL& url = web_contents->GetURL(); | 27 const GURL& url = web_contents->GetURL(); |
28 Profile* profile = | 28 Profile* profile = |
29 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 29 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 PopupBlockerTabHelper::FromWebContents(web_contents); | 110 PopupBlockerTabHelper::FromWebContents(web_contents); |
111 DCHECK(popup_blocker_helper); | 111 DCHECK(popup_blocker_helper); |
112 PopupBlockerTabHelper::PopupIdMap blocked_popups = | 112 PopupBlockerTabHelper::PopupIdMap blocked_popups = |
113 popup_blocker_helper->GetBlockedPopupRequests(); | 113 popup_blocker_helper->GetBlockedPopupRequests(); |
114 for (PopupBlockerTabHelper::PopupIdMap::iterator it = blocked_popups.begin(); | 114 for (PopupBlockerTabHelper::PopupIdMap::iterator it = blocked_popups.begin(); |
115 it != blocked_popups.end(); ++it) | 115 it != blocked_popups.end(); ++it) |
116 popup_blocker_helper->ShowBlockedPopup(it->first); | 116 popup_blocker_helper->ShowBlockedPopup(it->first); |
117 | 117 |
118 return true; | 118 return true; |
119 } | 119 } |
OLD | NEW |