OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/content_settings/content_settings_internal_extension_pr
ovider.h" | 5 #include "chrome/browser/content_settings/content_settings_internal_extension_pr
ovider.h" |
6 | 6 |
| 7 #include "chrome/browser/pdf/pdf_extension_util.h" |
7 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/common/chrome_content_client.h" | 9 #include "chrome/common/chrome_content_client.h" |
9 #include "chrome/common/extensions/api/plugins/plugins_handler.h" | 10 #include "chrome/common/extensions/api/plugins/plugins_handler.h" |
10 #include "components/content_settings/core/browser/content_settings_rule.h" | 11 #include "components/content_settings/core/browser/content_settings_rule.h" |
11 #include "components/content_settings/core/common/content_settings.h" | 12 #include "components/content_settings/core/common/content_settings.h" |
12 #include "components/content_settings/core/common/content_settings_pattern.h" | 13 #include "components/content_settings/core/common/content_settings_pattern.h" |
13 #include "content/public/browser/notification_details.h" | 14 #include "content/public/browser/notification_details.h" |
14 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
15 #include "extensions/browser/extension_host.h" | 16 #include "extensions/browser/extension_host.h" |
16 #include "extensions/browser/extension_registry.h" | 17 #include "extensions/browser/extension_registry.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // above check does not catch this, as the plugin is a builtin plugin. | 185 // above check does not catch this, as the plugin is a builtin plugin. |
185 if (chrome_remote_desktop_.find(extension->id()) != | 186 if (chrome_remote_desktop_.find(extension->id()) != |
186 chrome_remote_desktop_.end()) { | 187 chrome_remote_desktop_.end()) { |
187 SetContentSettingForExtensionAndResource( | 188 SetContentSettingForExtensionAndResource( |
188 extension, ChromeContentClient::kRemotingViewerPluginPath, setting); | 189 extension, ChromeContentClient::kRemotingViewerPluginPath, setting); |
189 } | 190 } |
190 | 191 |
191 // The PDF viewer extension relies on the out of process PDF plugin. | 192 // The PDF viewer extension relies on the out of process PDF plugin. |
192 if (extension->id() == extension_misc::kPdfExtensionId) { | 193 if (extension->id() == extension_misc::kPdfExtensionId) { |
193 SetContentSettingForExtensionAndResource( | 194 SetContentSettingForExtensionAndResource( |
194 extension, ChromeContentClient::kPDFPluginPath, setting); | 195 extension, pdf_extension_util::kPdfResourceIdentifier, setting); |
195 } | 196 } |
196 } | 197 } |
197 | 198 |
198 void InternalExtensionProvider::SetContentSettingForExtension( | 199 void InternalExtensionProvider::SetContentSettingForExtension( |
199 const extensions::Extension* extension, | 200 const extensions::Extension* extension, |
200 ContentSetting setting) { | 201 ContentSetting setting) { |
201 SetContentSettingForExtensionAndResource( | 202 SetContentSettingForExtensionAndResource( |
202 extension, ResourceIdentifier(), setting); | 203 extension, ResourceIdentifier(), setting); |
203 } | 204 } |
204 | 205 |
(...skipping 24 matching lines...) Expand all Loading... |
229 new base::FundamentalValue(setting)); | 230 new base::FundamentalValue(setting)); |
230 } | 231 } |
231 } | 232 } |
232 NotifyObservers(primary_pattern, | 233 NotifyObservers(primary_pattern, |
233 secondary_pattern, | 234 secondary_pattern, |
234 CONTENT_SETTINGS_TYPE_PLUGINS, | 235 CONTENT_SETTINGS_TYPE_PLUGINS, |
235 resource); | 236 resource); |
236 } | 237 } |
237 | 238 |
238 } // namespace content_settings | 239 } // namespace content_settings |
OLD | NEW |