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

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

Issue 230453004: Remove InfoBarDelegate::web_contents() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile Created 6 years, 8 months 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698