Skip to content

Commit

Permalink
Remove the flag kAppServiceContextMenu in c/b/ui/app_list.
Browse files Browse the repository at this point in the history
This is the preparing for removing the flag kAppServiceContextMenu.

The AppService context menu feature has been enabled for a few release,
and the flag is expired, so it can be removed in M86 release.

There will be a few follow up CLs to remove the flag from other parts of
the code.

BUG=1016159

Change-Id: I2512bc661d8eefa8ef0e44c48d90a2372ec04f4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2280770
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785668}
  • Loading branch information
nancylingwang@google.com authored and Commit Bot committed Jul 7, 2020
1 parent 9385e37 commit 11e9827
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 618 deletions.
6 changes: 0 additions & 6 deletions chrome/browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1584,8 +1584,6 @@ static_library("ui") {
"app_list/app_sync_ui_state_observer.h",
"app_list/app_sync_ui_state_watcher.cc",
"app_list/app_sync_ui_state_watcher.h",
"app_list/arc/arc_app_context_menu.cc",
"app_list/arc/arc_app_context_menu.h",
"app_list/arc/arc_app_dialog.h",
"app_list/arc/arc_app_icon.cc",
"app_list/arc/arc_app_icon.h",
Expand Down Expand Up @@ -1628,8 +1626,6 @@ static_library("ui") {
"app_list/chrome_app_list_item.h",
"app_list/chrome_app_list_model_updater.cc",
"app_list/chrome_app_list_model_updater.h",
"app_list/crostini/crostini_app_context_menu.cc",
"app_list/crostini/crostini_app_context_menu.h",
"app_list/extension_app_context_menu.cc",
"app_list/extension_app_context_menu.h",
"app_list/extension_app_utils.cc",
Expand Down Expand Up @@ -1758,8 +1754,6 @@ static_library("ui") {
"app_list/search/zero_state_file_provider.h",
"app_list/search/zero_state_file_result.cc",
"app_list/search/zero_state_file_result.h",
"app_list/web_app_context_menu.cc",
"app_list/web_app_context_menu.h",
"ash/accessibility/accessibility_controller_client.cc",
"ash/accessibility/accessibility_controller_client.h",
"ash/ambient/ambient_client_impl.cc",
Expand Down
66 changes: 2 additions & 64 deletions chrome/browser/ui/app_list/app_service/app_service_app_item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,70 +15,13 @@
#include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
#include "chrome/browser/ui/app_list/app_service/app_service_context_menu.h"
#include "chrome/browser/ui/app_list/arc/arc_app_context_menu.h"
#include "chrome/browser/ui/app_list/crostini/crostini_app_context_menu.h"
#include "chrome/browser/ui/app_list/extension_app_context_menu.h"
#include "chrome/browser/ui/app_list/web_app_context_menu.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/common/chrome_features.h"

// static
const char AppServiceAppItem::kItemType[] = "AppServiceAppItem";

// static
std::unique_ptr<app_list::AppContextMenu> AppServiceAppItem::MakeAppContextMenu(
apps::mojom::AppType app_type,
AppContextMenuDelegate* delegate,
Profile* profile,
const std::string& app_id,
AppListControllerDelegate* controller,
bool is_platform_app) {
// Terminal System App uses CrostiniAppContextMenu.
if (app_id == crostini::kCrostiniTerminalSystemAppId) {
return std::make_unique<CrostiniAppContextMenu>(profile, app_id,
controller);
}

switch (app_type) {
case apps::mojom::AppType::kUnknown:
case apps::mojom::AppType::kBuiltIn:
case apps::mojom::AppType::kLacros:
return std::make_unique<app_list::AppContextMenu>(delegate, profile,
app_id, controller);

case apps::mojom::AppType::kArc:
return std::make_unique<ArcAppContextMenu>(delegate, profile, app_id,
controller);

case apps::mojom::AppType::kCrostini:
return std::make_unique<CrostiniAppContextMenu>(profile, app_id,
controller);

case apps::mojom::AppType::kPluginVm:
return std::make_unique<app_list::AppContextMenu>(delegate, profile,
app_id, controller);

case apps::mojom::AppType::kWeb:
if (base::FeatureList::IsEnabled(
features::kDesktopPWAsWithoutExtensions)) {
return std::make_unique<app_list::WebAppContextMenu>(
delegate, profile, app_id, controller);
}
// Otherwise deliberately fall through to fallback on Bookmark Apps.
FALLTHROUGH;

case apps::mojom::AppType::kExtension:
return std::make_unique<app_list::ExtensionAppContextMenu>(
delegate, profile, app_id, controller, is_platform_app);

case apps::mojom::AppType::kMacNative:
NOTREACHED() << "Should not be trying to make a menu for a native app";
return nullptr;
}

return nullptr;
}

AppServiceAppItem::AppServiceAppItem(
Profile* profile,
AppListModelUpdater* model_updater,
Expand Down Expand Up @@ -165,13 +108,8 @@ const char* AppServiceAppItem::GetItemType() const {
}

void AppServiceAppItem::GetContextMenuModel(GetMenuModelCallback callback) {
if (base::FeatureList::IsEnabled(features::kAppServiceContextMenu)) {
context_menu_ = std::make_unique<AppServiceContextMenu>(
this, profile(), id(), GetController());
} else {
context_menu_ = MakeAppContextMenu(app_type_, this, profile(), id(),
GetController(), is_platform_app_);
}
context_menu_ = std::make_unique<AppServiceContextMenu>(this, profile(), id(),
GetController());

context_menu_->GetMenuModel(std::move(callback));
}
Expand Down
8 changes: 0 additions & 8 deletions chrome/browser/ui/app_list/app_service/app_service_app_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ class AppServiceAppItem : public ChromeAppListItem,
public:
static const char kItemType[];

static std::unique_ptr<app_list::AppContextMenu> MakeAppContextMenu(
apps::mojom::AppType app_type,
AppContextMenuDelegate* delegate,
Profile* profile,
const std::string& app_id,
AppListControllerDelegate* controller,
bool is_platform_app);

AppServiceAppItem(Profile* profile,
AppListModelUpdater* model_updater,
const app_list::AppListSyncableService::SyncItem* sync_item,
Expand Down
139 changes: 0 additions & 139 deletions chrome/browser/ui/app_list/arc/arc_app_context_menu.cc

This file was deleted.

53 changes: 0 additions & 53 deletions chrome/browser/ui/app_list/arc/arc_app_context_menu.h

This file was deleted.

1 change: 0 additions & 1 deletion chrome/browser/ui/app_list/crostini/OWNERS

This file was deleted.

73 changes: 0 additions & 73 deletions chrome/browser/ui/app_list/crostini/crostini_app_context_menu.cc

This file was deleted.

0 comments on commit 11e9827

Please sign in to comment.