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..54366a0a0c10ce75b8a1e92f308758d3dc685a83 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 |
not at google - send to devlin
2014/06/19 01:27:34
nit: 2 spaces before comment
Mike Wittman
2014/06/19 16:42:02
Done.
|
+ "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,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)) |
+ return true; |
not at google - send to devlin
2014/06/19 01:27:34
nit: curlies on body with multi-line condition.
Mike Wittman
2014/06/19 16:42:02
Done.
|
} |
return ExtensionPrefs::Get(context)->IsIncognitoEnabled(extension_id); |