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

Side by Side Diff: chrome/browser/content_settings/content_settings_internal_extension_provider.cc

Issue 850853002: Extensions: Consolidate extension id hashing / searching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 11 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
OLDNEW
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/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/common/chrome_content_client.h" 8 #include "chrome/common/chrome_content_client.h"
9 #include "chrome/common/extensions/api/plugins/plugins_handler.h" 9 #include "chrome/common/extensions/api/plugins/plugins_handler.h"
10 #include "components/content_settings/core/browser/content_settings_rule.h" 10 #include "components/content_settings/core/browser/content_settings_rule.h"
(...skipping 10 matching lines...) Expand all
21 #include "extensions/common/features/simple_feature.h" 21 #include "extensions/common/features/simple_feature.h"
22 22
23 using extensions::UnloadedExtensionInfo; 23 using extensions::UnloadedExtensionInfo;
24 24
25 namespace content_settings { 25 namespace content_settings {
26 26
27 namespace { 27 namespace {
28 28
29 // This is the set of extensions that are allowed to access the internal 29 // This is the set of extensions that are allowed to access the internal
30 // remoting viewer plugin. 30 // remoting viewer plugin.
31 const char* kRemotingViewerWhitelist[] = { 31 const char* const kRemotingViewerWhitelist[] = {
32 "gbchcmhmhahfdphkhkmpfmihenigjmpp", // Chrome Remote Desktop 32 "gbchcmhmhahfdphkhkmpfmihenigjmpp", // Chrome Remote Desktop
33 "kgngmbheleoaphbjbaiobfdepmghbfah", // Pre-release Chrome Remote Desktop 33 "kgngmbheleoaphbjbaiobfdepmghbfah", // Pre-release Chrome Remote Desktop
34 "odkaodonbgfohohmklejpjiejmcipmib", // Dogfood Chrome Remote Desktop 34 "odkaodonbgfohohmklejpjiejmcipmib", // Dogfood Chrome Remote Desktop
35 "ojoimpklfciegopdfgeenehpalipignm", // Chromoting canary 35 "ojoimpklfciegopdfgeenehpalipignm", // Chromoting canary
36 }; 36 };
37 37
38 } // namespace 38 } // namespace
39 39
40 40
41 InternalExtensionProvider::InternalExtensionProvider(Profile* profile) 41 InternalExtensionProvider::InternalExtensionProvider(Profile* profile)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 const ContentSettingsPattern& secondary_pattern, 76 const ContentSettingsPattern& secondary_pattern,
77 ContentSettingsType content_type, 77 ContentSettingsType content_type,
78 const ResourceIdentifier& resource_identifier, 78 const ResourceIdentifier& resource_identifier,
79 base::Value* value) { 79 base::Value* value) {
80 return false; 80 return false;
81 } 81 }
82 82
83 void InternalExtensionProvider::ClearAllContentSettingsRules( 83 void InternalExtensionProvider::ClearAllContentSettingsRules(
84 ContentSettingsType content_type) {} 84 ContentSettingsType content_type) {}
85 85
86 void InternalExtensionProvider::Observe(int type, 86 void InternalExtensionProvider::Observe(
87 const content::NotificationSource& source, 87 int type,
88 const content::NotificationDetails& details) { 88 const content::NotificationSource& source,
89 const content::NotificationDetails& details) {
89 switch (type) { 90 switch (type) {
90 case extensions::NOTIFICATION_EXTENSION_HOST_CREATED: { 91 case extensions::NOTIFICATION_EXTENSION_HOST_CREATED: {
91 const extensions::ExtensionHost* host = 92 const extensions::ExtensionHost* host =
92 content::Details<extensions::ExtensionHost>(details).ptr(); 93 content::Details<extensions::ExtensionHost>(details).ptr();
93 if (host->extension()->is_platform_app()) { 94 if (host->extension()->is_platform_app()) {
94 SetContentSettingForExtension(host->extension(), CONTENT_SETTING_BLOCK); 95 SetContentSettingForExtension(host->extension(), CONTENT_SETTING_BLOCK);
95 96
96 // White-list CRD's v2 app, until crbug.com/134216 is complete. 97 // White-list CRD's v2 app, until crbug.com/134216 is complete.
97 const char* kAppWhitelist[] = { 98 const char* const kAppWhitelist[] = {
98 "2775E568AC98F9578791F1EAB65A1BF5F8CEF414", 99 "2775E568AC98F9578791F1EAB65A1BF5F8CEF414",
99 "4AA3C5D69A4AECBD236CAD7884502209F0F5C169", 100 "4AA3C5D69A4AECBD236CAD7884502209F0F5C169",
100 "97B23E01B2AA064E8332EE43A7A85C628AADC3F2", 101 "97B23E01B2AA064E8332EE43A7A85C628AADC3F2",
101 "9E930B2B5EABA6243AE6C710F126E54688E8FAF6", 102 "9E930B2B5EABA6243AE6C710F126E54688E8FAF6",
102 "C449A798C495E6CF7D6AF10162113D564E67AD12", 103 "C449A798C495E6CF7D6AF10162113D564E67AD12",
103 "E410CDAB2C6E6DD408D731016CECF2444000A912", 104 "E410CDAB2C6E6DD408D731016CECF2444000A912",
104 "EBA908206905323CECE6DC4B276A58A0F4AC573F", 105 "EBA908206905323CECE6DC4B276A58A0F4AC573F",
105 106
106 // http://crbug.com/327507 107 // http://crbug.com/327507
107 "FAFE8EFDD2D6AE2EEB277AFEB91C870C79064D9E", 108 "FAFE8EFDD2D6AE2EEB277AFEB91C870C79064D9E",
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 new base::FundamentalValue(setting)); 223 new base::FundamentalValue(setting));
223 } 224 }
224 } 225 }
225 NotifyObservers(primary_pattern, 226 NotifyObservers(primary_pattern,
226 secondary_pattern, 227 secondary_pattern,
227 CONTENT_SETTINGS_TYPE_PLUGINS, 228 CONTENT_SETTINGS_TYPE_PLUGINS,
228 resource); 229 resource);
229 } 230 }
230 231
231 } // namespace content_settings 232 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698