Chromium Code Reviews| Index: chrome/browser/extensions/extension_util.cc |
| diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc |
| index f6ebc499445206ef47caf300c7f3ba22d45ce0a0..9ee3d782e3c72a7f69d100291b811611719dbc6d 100644 |
| --- a/chrome/browser/extensions/extension_util.cc |
| +++ b/chrome/browser/extensions/extension_util.cc |
| @@ -24,7 +24,8 @@ |
| #include "extensions/common/extension.h" |
| #include "extensions/common/extension_icon_set.h" |
| #include "extensions/common/feature_switch.h" |
| -#include "extensions/common/features/simple_feature.h" |
| +#include "extensions/common/features/feature_provider.h" |
| +#include "extensions/common/features/switch_feature.h" |
| #include "extensions/common/manifest.h" |
| #include "extensions/common/manifest_handlers/incognito_info.h" |
| #include "extensions/common/permissions/permissions_data.h" |
| @@ -41,20 +42,13 @@ namespace { |
| const char kExtensionAllowedOnAllUrlsPrefName[] = |
| "extension_can_script_all_urls"; |
| -// Returns true if |extension_id| for an external component extension should |
| -// always be enabled in incognito windows. |
| -bool IsWhitelistedForIncognito(const std::string& extension_id) { |
| - static const char* const kExtensionWhitelist[] = { |
| - "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 |
| - "D57DE394F36DC1C3220E7604C575D29C51A6C495", // http://crbug.com/319444 |
| - "3F65507A3B39259B38C8173C6FFA3D12DF64CCE9" // http://crbug.com/371562 |
| - }; |
| - |
| - return extensions::SimpleFeature::IsIdInList( |
| - extension_id, |
| - std::set<std::string>( |
| - kExtensionWhitelist, |
| - kExtensionWhitelist + arraysize(kExtensionWhitelist))); |
| +// Returns true if |extension_id| should always be enabled in incognito |
| +// windows. |
| +bool IsWhitelistedForIncognito(const Extension* extension) { |
| + return FeatureProvider::GetSwitchFeatures() |
|
not at google - send to devlin
2014/12/11 17:51:00
Btw, wdyt about renaming all of these to "GetSwitc
|
| + ->GetFeature(SwitchFeature::kWhitelistedForIncognito) |
| + ->IsAvailableToExtension(extension) |
| + .is_available(); |
| } |
| // Returns |extension_id|. See note below. |
| @@ -90,12 +84,9 @@ bool IsIncognitoEnabled(const std::string& extension_id, |
| // work in incognito mode. |
| if (extension->location() == Manifest::COMPONENT) |
| return true; |
| - if (extension->location() == Manifest::EXTERNAL_COMPONENT && |
| - IsWhitelistedForIncognito(extension_id)) { |
| + if (IsWhitelistedForIncognito(extension)) |
| return true; |
| - } |
| } |
| - |
| return ExtensionPrefs::Get(context)->IsIncognitoEnabled(extension_id); |
| } |