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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "chrome/browser/pdf/pdf_extension_util.h" | 10 #include "chrome/browser/pdf/pdf_extension_util.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/common/chrome_content_client.h" | 12 #include "chrome/common/chrome_content_client.h" |
13 #include "components/content_settings/core/browser/content_settings_rule.h" | 13 #include "components/content_settings/core/browser/content_settings_rule.h" |
14 #include "components/content_settings/core/common/content_settings.h" | 14 #include "components/content_settings/core/common/content_settings.h" |
15 #include "components/content_settings/core/common/content_settings_pattern.h" | 15 #include "components/content_settings/core/common/content_settings_pattern.h" |
16 #include "content/public/browser/notification_details.h" | 16 #include "content/public/browser/notification_details.h" |
17 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
18 #include "extensions/browser/extension_host.h" | 18 #include "extensions/browser/extension_host.h" |
19 #include "extensions/browser/extension_registry.h" | 19 #include "extensions/browser/extension_registry.h" |
20 #include "extensions/browser/notification_types.h" | 20 #include "extensions/browser/notification_types.h" |
21 #include "extensions/common/constants.h" | 21 #include "extensions/common/constants.h" |
22 #include "extensions/common/extension.h" | 22 #include "extensions/common/extension.h" |
23 #include "extensions/common/extension_set.h" | 23 #include "extensions/common/extension_set.h" |
24 #include "extensions/common/features/simple_feature.h" | 24 #include "extensions/common/features/simple_feature.h" |
25 #include "extensions/common/manifest_handlers/plugins_handler.h" | 25 #include "extensions/common/manifest_handlers/plugins_handler.h" |
26 | 26 |
27 using extensions::UnloadedExtensionInfo; | 27 using extensions::UnloadedExtensionReason; |
Devlin
2017/05/01 14:08:57
I know this was just copy-replace, but it looks li
limasdf
2017/05/02 07:52:52
Done.
| |
28 | 28 |
29 namespace content_settings { | 29 namespace content_settings { |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 // This is the set of extensions that are allowed to access the internal | 33 // This is the set of extensions that are allowed to access the internal |
34 // remoting viewer plugin. | 34 // remoting viewer plugin. |
35 const char* const kRemotingViewerWhitelist[] = { | 35 const char* const kRemotingViewerWhitelist[] = { |
36 "gbchcmhmhahfdphkhkmpfmihenigjmpp", // Chrome Remote Desktop | 36 "gbchcmhmhahfdphkhkmpfmihenigjmpp", // Chrome Remote Desktop |
37 "kgngmbheleoaphbjbaiobfdepmghbfah", // Pre-release Chrome Remote Desktop | 37 "kgngmbheleoaphbjbaiobfdepmghbfah", // Pre-release Chrome Remote Desktop |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 | 145 |
146 void InternalExtensionProvider::OnExtensionLoaded( | 146 void InternalExtensionProvider::OnExtensionLoaded( |
147 content::BrowserContext* browser_context, | 147 content::BrowserContext* browser_context, |
148 const extensions::Extension* extension) { | 148 const extensions::Extension* extension) { |
149 ApplyPluginContentSettingsForExtension(extension, CONTENT_SETTING_ALLOW); | 149 ApplyPluginContentSettingsForExtension(extension, CONTENT_SETTING_ALLOW); |
150 } | 150 } |
151 | 151 |
152 void InternalExtensionProvider::OnExtensionUnloaded( | 152 void InternalExtensionProvider::OnExtensionUnloaded( |
153 content::BrowserContext* browser_context, | 153 content::BrowserContext* browser_context, |
154 const extensions::Extension* extension, | 154 const extensions::Extension* extension, |
155 extensions::UnloadedExtensionInfo::Reason reason) { | 155 extensions::UnloadedExtensionReason reason) { |
156 ApplyPluginContentSettingsForExtension(extension, CONTENT_SETTING_DEFAULT); | 156 ApplyPluginContentSettingsForExtension(extension, CONTENT_SETTING_DEFAULT); |
157 } | 157 } |
158 | 158 |
159 void InternalExtensionProvider::ShutdownOnUIThread() { | 159 void InternalExtensionProvider::ShutdownOnUIThread() { |
160 DCHECK(CalledOnValidThread()); | 160 DCHECK(CalledOnValidThread()); |
161 RemoveAllObservers(); | 161 RemoveAllObservers(); |
162 registrar_.reset(); | 162 registrar_.reset(); |
163 extension_registry_->RemoveObserver(this); | 163 extension_registry_->RemoveObserver(this); |
164 } | 164 } |
165 | 165 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 new base::Value(setting)); | 216 new base::Value(setting)); |
217 } | 217 } |
218 } | 218 } |
219 NotifyObservers(primary_pattern, | 219 NotifyObservers(primary_pattern, |
220 secondary_pattern, | 220 secondary_pattern, |
221 CONTENT_SETTINGS_TYPE_PLUGINS, | 221 CONTENT_SETTINGS_TYPE_PLUGINS, |
222 resource); | 222 resource); |
223 } | 223 } |
224 | 224 |
225 } // namespace content_settings | 225 } // namespace content_settings |
OLD | NEW |