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

Side by Side Diff: chrome/browser/pepper_broker_infobar_delegate.cc

Issue 14241006: Eliminate InfoBarTabHelper. Make InfoBarService a concrete class. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/pepper_broker_infobar_delegate.h" 5 #include "chrome/browser/pepper_broker_infobar_delegate.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/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); 151 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
152 } 152 }
153 153
154 bool PepperBrokerInfoBarDelegate::LinkClicked( 154 bool PepperBrokerInfoBarDelegate::LinkClicked(
155 WindowOpenDisposition disposition) { 155 WindowOpenDisposition disposition) {
156 OpenURLParams params( 156 OpenURLParams params(
157 GURL(kPpapiBrokerLearnMoreUrl), Referrer(), 157 GURL(kPpapiBrokerLearnMoreUrl), Referrer(),
158 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 158 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
159 content::PAGE_TRANSITION_LINK, 159 content::PAGE_TRANSITION_LINK,
160 false); 160 false);
161 owner()->GetWebContents()->OpenURL(params); 161 owner()->web_contents()->OpenURL(params);
162 return false; 162 return false;
163 } 163 }
164 164
165 gfx::Image* PepperBrokerInfoBarDelegate::GetIcon() const { 165 gfx::Image* PepperBrokerInfoBarDelegate::GetIcon() const {
166 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 166 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
167 IDR_INFOBAR_PLUGIN_INSTALL); 167 IDR_INFOBAR_PLUGIN_INSTALL);
168 } 168 }
169 169
170 PepperBrokerInfoBarDelegate::PepperBrokerInfoBarDelegate( 170 PepperBrokerInfoBarDelegate::PepperBrokerInfoBarDelegate(
171 InfoBarService* infobar_service, 171 InfoBarService* infobar_service,
(...skipping 23 matching lines...) Expand all
195 content::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); 195 content::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny"));
196 callback_.Run(result); 196 callback_.Run(result);
197 callback_ = base::Callback<void(bool)>(); 197 callback_ = base::Callback<void(bool)>();
198 content_settings_->SetContentSetting( 198 content_settings_->SetContentSetting(
199 ContentSettingsPattern::FromURLNoWildcard(url_), 199 ContentSettingsPattern::FromURLNoWildcard(url_),
200 ContentSettingsPattern::Wildcard(), 200 ContentSettingsPattern::Wildcard(),
201 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, 201 CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
202 std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); 202 std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK);
203 tab_content_settings_->SetPepperBrokerAllowed(result); 203 tab_content_settings_->SetPepperBrokerAllowed(result);
204 } 204 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_manager_browsertest.cc ('k') | chrome/browser/plugins/plugin_infobar_delegates.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698