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

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

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 5 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
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_factory.h" 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 content_settings_(content_settings), 86 content_settings_(content_settings),
87 tab_content_settings_(tab_content_settings), 87 tab_content_settings_(tab_content_settings),
88 callback_(callback) { 88 callback_(callback) {
89 } 89 }
90 90
91 PepperBrokerInfoBarDelegate::~PepperBrokerInfoBarDelegate() { 91 PepperBrokerInfoBarDelegate::~PepperBrokerInfoBarDelegate() {
92 if (!callback_.is_null()) 92 if (!callback_.is_null())
93 callback_.Run(false); 93 callback_.Run(false);
94 } 94 }
95 95
96 std::string PepperBrokerInfoBarDelegate::GetIdentifier() const {
97 return "PepperBrokerInfoBarDelegate";
98 }
99
96 int PepperBrokerInfoBarDelegate::GetIconId() const { 100 int PepperBrokerInfoBarDelegate::GetIconId() const {
97 return IDR_INFOBAR_PLUGIN_INSTALL; 101 return IDR_INFOBAR_PLUGIN_INSTALL;
98 } 102 }
99 103
100 base::string16 PepperBrokerInfoBarDelegate::GetMessageText() const { 104 base::string16 PepperBrokerInfoBarDelegate::GetMessageText() const {
101 content::PluginService* plugin_service = 105 content::PluginService* plugin_service =
102 content::PluginService::GetInstance(); 106 content::PluginService::GetInstance();
103 content::WebPluginInfo plugin; 107 content::WebPluginInfo plugin;
104 bool success = plugin_service->GetPluginInfoByPath(plugin_path_, &plugin); 108 bool success = plugin_service->GetPluginInfoByPath(plugin_path_, &plugin);
105 DCHECK(success); 109 DCHECK(success);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 base::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); 144 base::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny"));
141 callback_.Run(result); 145 callback_.Run(result);
142 callback_ = base::Callback<void(bool)>(); 146 callback_ = base::Callback<void(bool)>();
143 content_settings_->SetContentSetting( 147 content_settings_->SetContentSetting(
144 ContentSettingsPattern::FromURLNoWildcard(url_), 148 ContentSettingsPattern::FromURLNoWildcard(url_),
145 ContentSettingsPattern::Wildcard(), 149 ContentSettingsPattern::Wildcard(),
146 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, 150 CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
147 std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); 151 std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK);
148 tab_content_settings_->SetPepperBrokerAllowed(result); 152 tab_content_settings_->SetPepperBrokerAllowed(result);
149 } 153 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698