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

Unified Diff: chrome/browser/extensions/extension_util.cc

Issue 2758103003: Extensions: Move IsIncognitoEnabled to extensions/ from chrome/. (Closed)
Patch Set: Address review Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_util.cc
diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc
index ba4c4704ca4749d34ab67cb7b071730c675ae23c..e436f1ed428b5b04b91107055efd28698c214412 100644
--- a/chrome/browser/extensions/extension_util.cc
+++ b/chrome/browser/extensions/extension_util.cc
@@ -28,9 +28,6 @@
#include "extensions/browser/extension_util.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_icon_set.h"
-#include "extensions/common/features/behavior_feature.h"
-#include "extensions/common/features/feature.h"
-#include "extensions/common/features/feature_provider.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_handlers/app_isolation_info.h"
#include "extensions/common/manifest_handlers/incognito_info.h"
@@ -50,13 +47,6 @@ namespace {
// It is relevant only for supervised users.
const char kWasInstalledByCustodianPrefName[] = "was_installed_by_custodian";
-// Returns true if |extension| should always be enabled in incognito mode.
-bool IsWhitelistedForIncognito(const Extension* extension) {
- const Feature* feature = FeatureProvider::GetBehaviorFeature(
- behavior_feature::kWhitelistedForIncognito);
- return feature && feature->IsAvailableToExtension(extension).is_available();
-}
-
// Returns |extension_id|. See note below.
std::string ReloadExtensionIfEnabled(const std::string& extension_id,
content::BrowserContext* context) {
@@ -79,25 +69,6 @@ std::string ReloadExtensionIfEnabled(const std::string& extension_id,
} // namespace
-bool IsIncognitoEnabled(const std::string& extension_id,
- content::BrowserContext* context) {
- const Extension* extension = ExtensionRegistry::Get(context)->
- GetExtensionById(extension_id, ExtensionRegistry::ENABLED);
- if (extension) {
- if (!util::CanBeIncognitoEnabled(extension))
- return false;
- // If this is an existing component extension we always allow it to
- // work in incognito mode.
- if (extension->location() == Manifest::COMPONENT ||
- extension->location() == Manifest::EXTERNAL_COMPONENT) {
- return true;
- }
- if (IsWhitelistedForIncognito(extension))
- return true;
- }
- return ExtensionPrefs::Get(context)->IsIncognitoEnabled(extension_id);
-}
-
void SetIsIncognitoEnabled(const std::string& extension_id,
content::BrowserContext* context,
bool enabled) {
« no previous file with comments | « chrome/browser/extensions/extension_util.h ('k') | chrome/browser/extensions/extension_view_host_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698