Commit 650f76dd authored by Jeevan Shikaram's avatar Jeevan Shikaram Committed by Commit Bot

[App Management] Show component extensions in App Management.

Show component extensions in App Management if they are shown in the laucher.
Disable crostini apps until implementation in App Management.

Bug: 953587
Change-Id: I24adbacfeb0b3663a45ef8bf8625d702627cdc75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1580990Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Jeevan Shikaram <jshikaram@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653510}
parent 774ff5a9
...@@ -210,7 +210,9 @@ apps::mojom::AppPtr CrostiniApps::Convert( ...@@ -210,7 +210,9 @@ apps::mojom::AppPtr CrostiniApps::Convert(
: apps::mojom::OptionalBool::kFalse; : apps::mojom::OptionalBool::kFalse;
app->show_in_launcher = show; app->show_in_launcher = show;
app->show_in_search = show; app->show_in_search = show;
app->show_in_management = show; // TODO(crbug.com/955937): Enable once Crostini apps are managed inside App
// Management.
app->show_in_management = apps::mojom::OptionalBool::kFalse;
return app; return app;
} }
......
...@@ -376,7 +376,7 @@ void ExtensionApps::SetShowInFields(apps::mojom::AppPtr& app, ...@@ -376,7 +376,7 @@ void ExtensionApps::SetShowInFields(apps::mojom::AppPtr& app,
: apps::mojom::OptionalBool::kFalse; : apps::mojom::OptionalBool::kFalse;
app->show_in_launcher = show; app->show_in_launcher = show;
app->show_in_search = show; app->show_in_search = show;
app->show_in_management = ShouldShowInAppManagement(extension); app->show_in_management = show;
} else { } else {
app->show_in_launcher = apps::mojom::OptionalBool::kFalse; app->show_in_launcher = apps::mojom::OptionalBool::kFalse;
app->show_in_search = apps::mojom::OptionalBool::kFalse; app->show_in_search = apps::mojom::OptionalBool::kFalse;
...@@ -402,21 +402,6 @@ bool ExtensionApps::ShouldShow(const extensions::Extension* extension, ...@@ -402,21 +402,6 @@ bool ExtensionApps::ShouldShow(const extensions::Extension* extension,
registry->terminated_extensions().Contains(app_id); registry->terminated_extensions().Contains(app_id);
} }
// static
apps::mojom::OptionalBool ExtensionApps::ShouldShowInAppManagement(
const extensions::Extension* extension) {
// Component extensions should not show up in App Management as they
// are only extensions as an implementation detail of Chrome, and have
// no meaningful settings.
if (extensions::Manifest::IsComponentLocation(extension->location()) &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
extensions::switches::kShowComponentExtensionOptions)) {
return apps::mojom::OptionalBool::kFalse;
} else {
return apps::mojom::OptionalBool::kTrue;
}
}
void ExtensionApps::PopulatePermissions( void ExtensionApps::PopulatePermissions(
const extensions::Extension* extension, const extensions::Extension* extension,
std::vector<mojom::PermissionPtr>* target) { std::vector<mojom::PermissionPtr>* target) {
......
...@@ -94,8 +94,6 @@ class ExtensionApps : public apps::mojom::Publisher, ...@@ -94,8 +94,6 @@ class ExtensionApps : public apps::mojom::Publisher,
Profile* profile); Profile* profile);
static bool ShouldShow(const extensions::Extension* extension, static bool ShouldShow(const extensions::Extension* extension,
Profile* profile); Profile* profile);
static apps::mojom::OptionalBool ShouldShowInAppManagement(
const extensions::Extension* extension);
void PopulatePermissions(const extensions::Extension* extension, void PopulatePermissions(const extensions::Extension* extension,
std::vector<mojom::PermissionPtr>* target); std::vector<mojom::PermissionPtr>* target);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment