Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc

Issue 1417023007: Replace HostContentSettingsMap::AddExceptionForURL with SetNarrowestWebsiteSetting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/content_settings/content_setting_bubble_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_factory.h" 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
9 #include "chrome/browser/infobars/infobar_service.h" 9 #include "chrome/browser/infobars/infobar_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 base::string16 PopupBlockedInfoBarDelegate::GetButtonLabel( 86 base::string16 PopupBlockedInfoBarDelegate::GetButtonLabel(
87 InfoBarButton button) const { 87 InfoBarButton button) const {
88 return l10n_util::GetStringUTF16(IDS_POPUPS_BLOCKED_INFOBAR_BUTTON_SHOW); 88 return l10n_util::GetStringUTF16(IDS_POPUPS_BLOCKED_INFOBAR_BUTTON_SHOW);
89 } 89 }
90 90
91 bool PopupBlockedInfoBarDelegate::Accept() { 91 bool PopupBlockedInfoBarDelegate::Accept() {
92 DCHECK(can_show_popups_); 92 DCHECK(can_show_popups_);
93 93
94 // Create exceptions. 94 // Create exceptions.
95 map_->AddExceptionForURL( 95 map_->SetNarrowestContentSetting(url_, url_, CONTENT_SETTINGS_TYPE_POPUPS,
96 url_, url_, CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW); 96 CONTENT_SETTING_ALLOW);
97 97
98 // Launch popups. 98 // Launch popups.
99 content::WebContents* web_contents = 99 content::WebContents* web_contents =
100 InfoBarService::WebContentsFromInfoBar(infobar()); 100 InfoBarService::WebContentsFromInfoBar(infobar());
101 PopupBlockerTabHelper* popup_blocker_helper = 101 PopupBlockerTabHelper* popup_blocker_helper =
102 PopupBlockerTabHelper::FromWebContents(web_contents); 102 PopupBlockerTabHelper::FromWebContents(web_contents);
103 DCHECK(popup_blocker_helper); 103 DCHECK(popup_blocker_helper);
104 PopupBlockerTabHelper::PopupIdMap blocked_popups = 104 PopupBlockerTabHelper::PopupIdMap blocked_popups =
105 popup_blocker_helper->GetBlockedPopupRequests(); 105 popup_blocker_helper->GetBlockedPopupRequests();
106 for (PopupBlockerTabHelper::PopupIdMap::iterator it = blocked_popups.begin(); 106 for (PopupBlockerTabHelper::PopupIdMap::iterator it = blocked_popups.begin();
107 it != blocked_popups.end(); ++it) 107 it != blocked_popups.end(); ++it)
108 popup_blocker_helper->ShowBlockedPopup(it->first); 108 popup_blocker_helper->ShowBlockedPopup(it->first);
109 109
110 return true; 110 return true;
111 } 111 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/content_settings/content_setting_bubble_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698