Commit 6a70ccaf authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Remove kDesktopPWAsWithoutExtensions flag check in AppServiceContextMenu

The kWeb branch in AppServiceContextMenu::IsCommandIdChecked() is
capable of handling web apps that run using BMO or Extensions as the
backend. This CL removes the flag check and fallthrough behaviour.

Bug: 897314
Change-Id: I530988629aa92e13d3cac9ccb8bcd500c1e7f7c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087247
Auto-Submit: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747462}
parent dc9689a6
...@@ -154,8 +154,6 @@ void AppServiceContextMenu::ExecuteCommand(int command_id, int event_flags) { ...@@ -154,8 +154,6 @@ void AppServiceContextMenu::ExecuteCommand(int command_id, int event_flags) {
bool AppServiceContextMenu::IsCommandIdChecked(int command_id) const { bool AppServiceContextMenu::IsCommandIdChecked(int command_id) const {
switch (app_type_) { switch (app_type_) {
case apps::mojom::AppType::kWeb: case apps::mojom::AppType::kWeb:
if (base::FeatureList::IsEnabled(
features::kDesktopPWAsWithoutExtensions)) {
if (command_id >= ash::USE_LAUNCH_TYPE_COMMAND_START && if (command_id >= ash::USE_LAUNCH_TYPE_COMMAND_START &&
command_id < ash::USE_LAUNCH_TYPE_COMMAND_END) { command_id < ash::USE_LAUNCH_TYPE_COMMAND_END) {
auto* provider = web_app::WebAppProvider::Get(profile()); auto* provider = web_app::WebAppProvider::Get(profile());
...@@ -167,9 +165,6 @@ bool AppServiceContextMenu::IsCommandIdChecked(int command_id) const { ...@@ -167,9 +165,6 @@ bool AppServiceContextMenu::IsCommandIdChecked(int command_id) const {
ConvertUseLaunchTypeCommandToDisplayMode(command_id); ConvertUseLaunchTypeCommandToDisplayMode(command_id);
} }
return AppContextMenu::IsCommandIdChecked(command_id); return AppContextMenu::IsCommandIdChecked(command_id);
}
// Otherwise deliberately fall through to fallback on Bookmark Apps.
FALLTHROUGH;
case apps::mojom::AppType::kExtension: case apps::mojom::AppType::kExtension:
if (command_id >= ash::USE_LAUNCH_TYPE_COMMAND_START && if (command_id >= ash::USE_LAUNCH_TYPE_COMMAND_START &&
command_id < ash::USE_LAUNCH_TYPE_COMMAND_END) { command_id < ash::USE_LAUNCH_TYPE_COMMAND_END) {
...@@ -295,9 +290,7 @@ void AppServiceContextMenu::ShowAppInfo() { ...@@ -295,9 +290,7 @@ void AppServiceContextMenu::ShowAppInfo() {
void AppServiceContextMenu::SetLaunchType(int command_id) { void AppServiceContextMenu::SetLaunchType(int command_id) {
switch (app_type_) { switch (app_type_) {
case apps::mojom::AppType::kWeb: case apps::mojom::AppType::kWeb: {
if (base::FeatureList::IsEnabled(
features::kDesktopPWAsWithoutExtensions)) {
// Web apps can only toggle between kStandalone and kBrowser. // Web apps can only toggle between kStandalone and kBrowser.
web_app::DisplayMode user_display_mode = web_app::DisplayMode user_display_mode =
ConvertUseLaunchTypeCommandToDisplayMode(command_id); ConvertUseLaunchTypeCommandToDisplayMode(command_id);
...@@ -309,8 +302,6 @@ void AppServiceContextMenu::SetLaunchType(int command_id) { ...@@ -309,8 +302,6 @@ void AppServiceContextMenu::SetLaunchType(int command_id) {
} }
return; return;
} }
// Otherwise deliberately fall through to fallback on Bookmark Apps.
FALLTHROUGH;
case apps::mojom::AppType::kExtension: { case apps::mojom::AppType::kExtension: {
// Hosted apps can only toggle between LAUNCH_TYPE_WINDOW and // Hosted apps can only toggle between LAUNCH_TYPE_WINDOW and
// LAUNCH_TYPE_REGULAR. // LAUNCH_TYPE_REGULAR.
......
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