| Index: chrome/browser/extensions/extension_util.cc
|
| diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc
|
| index 9273ed4420aa01c54802ae213842eb2318ea0cb9..bd6a989e372274c7e4c18c8dc150a5eebb2cbcdf 100644
|
| --- a/chrome/browser/extensions/extension_util.cc
|
| +++ b/chrome/browser/extensions/extension_util.cc
|
| @@ -21,6 +21,7 @@
|
| #include "extensions/browser/extension_util.h"
|
| #include "extensions/common/extension.h"
|
| #include "extensions/common/extension_icon_set.h"
|
| +#include "extensions/common/features/simple_feature.h"
|
| #include "extensions/common/manifest.h"
|
| #include "extensions/common/manifest_handlers/incognito_info.h"
|
| #include "grit/theme_resources.h"
|
| @@ -34,7 +35,23 @@ namespace {
|
| // all urls without explicit permission.
|
| 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* 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)));
|
| }
|
| +} // namespace
|
|
|
| bool IsIncognitoEnabled(const std::string& extension_id,
|
| content::BrowserContext* context) {
|
| @@ -47,6 +64,10 @@ 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)) {
|
| + return true;
|
| + }
|
| }
|
|
|
| return ExtensionPrefs::Get(context)->IsIncognitoEnabled(extension_id);
|
|
|