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

Unified Diff: extensions/common/extension.cc

Issue 2645863004: Simplify managing visibility of extensions in settings. (Closed)
Patch Set: Fixed logic so tests pass. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/extension.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/extension.cc
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
index 9b46a92c976f67d51d736c3bbe8686236187e267..3160619c83db9df9b48a283ec464885822767c20 100644
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -357,43 +357,29 @@ bool Extension::ShouldDisplayInExtensionSettings() const {
if (is_theme())
return false;
- // Don't show component extensions and invisible apps.
- if (ShouldNotBeVisible())
+ // Hide component extensions because they are only extensions as an
+ // implementation detail of Chrome.
+ if (extensions::Manifest::IsComponentLocation(location()) &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kShowComponentExtensionOptions)) {
return false;
-
- // Always show unpacked extensions and apps.
- if (Manifest::IsUnpackedLocation(location()))
- return true;
+ }
// Unless they are unpacked, never show hosted apps. Note: We intentionally
// show packaged apps and platform apps because there are some pieces of
// functionality that are only available in chrome://extensions/ but which
// are needed for packaged and platform apps. For example, inspecting
// background pages. See http://crbug.com/116134.
- if (is_hosted_app())
+ if (!Manifest::IsUnpackedLocation(location()) && is_hosted_app())
return false;
return true;
}
-bool Extension::ShouldNotBeVisible() const {
- // Don't show component extensions because they are only extensions as an
+bool Extension::ShouldExposeViaManagementAPI() const {
+ // Hide component extensions because they are only extensions as an
// implementation detail of Chrome.
- if (extensions::Manifest::IsComponentLocation(location()) &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kShowComponentExtensionOptions)) {
- return true;
- }
-
- // Always show unpacked extensions and apps.
- if (Manifest::IsUnpackedLocation(location()))
- return false;
-
- // Don't show apps that aren't visible in either launcher or ntp.
- if (is_app() && !ShouldDisplayInAppLauncher() && !ShouldDisplayInNewTabPage())
lazyboy 2017/01/23 22:22:26 2) Apps that didn't specify to show themselves in
mtomasz 2017/01/26 08:38:30 Correct. I believe this was a bug. Hiding from lau
- return true;
-
- return false;
+ return !extensions::Manifest::IsComponentLocation(location());
lazyboy 2017/01/23 22:22:26 1) So management api won't see component extension
mtomasz 2017/01/26 08:38:30 Correct. --show-component-extensions-options refer
}
Extension::ManifestData* Extension::GetManifestData(const std::string& key)
« no previous file with comments | « extensions/common/extension.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698