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

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

Issue 106713004: Remove kEnableResourceContentSettings and all the code that uses it since it's been behind a flag f… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 7 years 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 | Annotate | Revision Log
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.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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 InfoBarButton button) const { 68 InfoBarButton button) const {
69 return l10n_util::GetStringUTF16(IDS_POPUPS_BLOCKED_INFOBAR_BUTTON_SHOW); 69 return l10n_util::GetStringUTF16(IDS_POPUPS_BLOCKED_INFOBAR_BUTTON_SHOW);
70 } 70 }
71 71
72 bool PopupBlockedInfoBarDelegate::Accept() { 72 bool PopupBlockedInfoBarDelegate::Accept() {
73 // Create exceptions. 73 // Create exceptions.
74 const GURL& url = web_contents()->GetURL(); 74 const GURL& url = web_contents()->GetURL();
75 Profile* profile = Profile::FromBrowserContext( 75 Profile* profile = Profile::FromBrowserContext(
76 web_contents()->GetBrowserContext()); 76 web_contents()->GetBrowserContext());
77 profile->GetHostContentSettingsMap()->AddExceptionForURL( 77 profile->GetHostContentSettingsMap()->AddExceptionForURL(
78 url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string(), 78 url, url, CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW);
79 CONTENT_SETTING_ALLOW);
80 79
81 // Launch popups. 80 // Launch popups.
82 PopupBlockerTabHelper* popup_blocker_helper = 81 PopupBlockerTabHelper* popup_blocker_helper =
83 PopupBlockerTabHelper::FromWebContents(web_contents()); 82 PopupBlockerTabHelper::FromWebContents(web_contents());
84 DCHECK(popup_blocker_helper); 83 DCHECK(popup_blocker_helper);
85 PopupBlockerTabHelper::PopupIdMap blocked_popups = 84 PopupBlockerTabHelper::PopupIdMap blocked_popups =
86 popup_blocker_helper->GetBlockedPopupRequests(); 85 popup_blocker_helper->GetBlockedPopupRequests();
87 for (PopupBlockerTabHelper::PopupIdMap::iterator it = blocked_popups.begin(); 86 for (PopupBlockerTabHelper::PopupIdMap::iterator it = blocked_popups.begin();
88 it != blocked_popups.end(); ++it) 87 it != blocked_popups.end(); ++it)
89 popup_blocker_helper->ShowBlockedPopup(it->first); 88 popup_blocker_helper->ShowBlockedPopup(it->first);
90 89
91 return true; 90 return true;
92 } 91 }
93 92
OLDNEW
« no previous file with comments | « chrome/browser/plugins/plugin_infobar_delegates.cc ('k') | chrome/browser/ui/blocked_content/popup_blocker_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698