| OLD | NEW |
| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 content_settings_(content_settings), | 143 content_settings_(content_settings), |
| 144 tab_content_settings_(tab_content_settings), | 144 tab_content_settings_(tab_content_settings), |
| 145 callback_(callback) { | 145 callback_(callback) { |
| 146 } | 146 } |
| 147 | 147 |
| 148 PepperBrokerInfoBarDelegate::~PepperBrokerInfoBarDelegate() { | 148 PepperBrokerInfoBarDelegate::~PepperBrokerInfoBarDelegate() { |
| 149 if (!callback_.is_null()) | 149 if (!callback_.is_null()) |
| 150 callback_.Run(false); | 150 callback_.Run(false); |
| 151 } | 151 } |
| 152 | 152 |
| 153 gfx::Image* PepperBrokerInfoBarDelegate::GetIcon() const { | 153 int PepperBrokerInfoBarDelegate::GetIconID() const { |
| 154 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 154 return IDR_INFOBAR_PLUGIN_INSTALL; |
| 155 IDR_INFOBAR_PLUGIN_INSTALL); | |
| 156 } | 155 } |
| 157 | 156 |
| 158 string16 PepperBrokerInfoBarDelegate::GetMessageText() const { | 157 string16 PepperBrokerInfoBarDelegate::GetMessageText() const { |
| 159 content::PluginService* plugin_service = | 158 content::PluginService* plugin_service = |
| 160 content::PluginService::GetInstance(); | 159 content::PluginService::GetInstance(); |
| 161 webkit::WebPluginInfo plugin; | 160 webkit::WebPluginInfo plugin; |
| 162 bool success = plugin_service->GetPluginInfoByPath(plugin_path_, &plugin); | 161 bool success = plugin_service->GetPluginInfoByPath(plugin_path_, &plugin); |
| 163 DCHECK(success); | 162 DCHECK(success); |
| 164 scoped_ptr<PluginMetadata> plugin_metadata( | 163 scoped_ptr<PluginMetadata> plugin_metadata( |
| 165 PluginFinder::GetInstance()->GetPluginMetadata(plugin)); | 164 PluginFinder::GetInstance()->GetPluginMetadata(plugin)); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 content::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); | 216 content::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); |
| 218 callback_.Run(result); | 217 callback_.Run(result); |
| 219 callback_ = base::Callback<void(bool)>(); | 218 callback_ = base::Callback<void(bool)>(); |
| 220 content_settings_->SetContentSetting( | 219 content_settings_->SetContentSetting( |
| 221 ContentSettingsPattern::FromURLNoWildcard(url_), | 220 ContentSettingsPattern::FromURLNoWildcard(url_), |
| 222 ContentSettingsPattern::Wildcard(), | 221 ContentSettingsPattern::Wildcard(), |
| 223 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, | 222 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, |
| 224 std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); | 223 std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); |
| 225 tab_content_settings_->SetPepperBrokerAllowed(result); | 224 tab_content_settings_->SetPepperBrokerAllowed(result); |
| 226 } | 225 } |
| OLD | NEW |