Commit 6bcfe2ad authored by nancy's avatar nancy Committed by Commit Bot

Add menu items structure in App Service.

This is the first CL for integrating context menus to App Service.
There will be follow up for this CL to add more menus to App Service:
1. Add Radio menu items
2. Add sub menu.
3. Add menu items for Crostini.
4. Add menu items for ARC apps.
5. Add menu items for Chrome apps/extension apps.
6. Add menu items for Web apps.

BUG=1038487

Change-Id: I933bb680f0f5356eb4675f648664b6280f340c22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1999895
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#731878}
parent 76fb541a
...@@ -3730,6 +3730,8 @@ jumbo_static_library("browser") { ...@@ -3730,6 +3730,8 @@ jumbo_static_library("browser") {
"apps/app_service/extension_apps.h", "apps/app_service/extension_apps.h",
"apps/app_service/icon_key_util.cc", "apps/app_service/icon_key_util.cc",
"apps/app_service/icon_key_util.h", "apps/app_service/icon_key_util.h",
"apps/app_service/menu_util.cc",
"apps/app_service/menu_util.h",
"apps/app_service/web_apps.cc", "apps/app_service/web_apps.cc",
"apps/app_service/web_apps.h", "apps/app_service/web_apps.h",
"component_updater/cros_component_installer_chromeos.cc", "component_updater/cros_component_installer_chromeos.cc",
......
...@@ -265,8 +265,9 @@ void AppServiceProxy::OnUninstallDialogClosed( ...@@ -265,8 +265,9 @@ void AppServiceProxy::OnUninstallDialogClosed(
bool clear_site_data, bool clear_site_data,
bool report_abuse, bool report_abuse,
UninstallDialog* uninstall_dialog) { UninstallDialog* uninstall_dialog) {
if (uninstall) if (uninstall) {
app_service_->Uninstall(app_type, app_id, clear_site_data, report_abuse); app_service_->Uninstall(app_type, app_id, clear_site_data, report_abuse);
}
DCHECK(uninstall_dialog); DCHECK(uninstall_dialog);
auto it = uninstall_dialogs_.find(uninstall_dialog); auto it = uninstall_dialogs_.find(uninstall_dialog);
...@@ -276,8 +277,9 @@ void AppServiceProxy::OnUninstallDialogClosed( ...@@ -276,8 +277,9 @@ void AppServiceProxy::OnUninstallDialogClosed(
void AppServiceProxy::PauseApps( void AppServiceProxy::PauseApps(
const std::map<std::string, PauseData>& pause_data) { const std::map<std::string, PauseData>& pause_data) {
if (!app_service_.is_connected()) if (!app_service_.is_connected()) {
return; return;
}
for (auto& data : pause_data) { for (auto& data : pause_data) {
apps::mojom::AppType app_type = cache_.GetAppType(data.first); apps::mojom::AppType app_type = cache_.GetAppType(data.first);
...@@ -296,8 +298,9 @@ void AppServiceProxy::PauseApps( ...@@ -296,8 +298,9 @@ void AppServiceProxy::PauseApps(
} }
void AppServiceProxy::UnpauseApps(const std::set<std::string>& app_ids) { void AppServiceProxy::UnpauseApps(const std::set<std::string>& app_ids) {
if (!app_service_.is_connected()) if (!app_service_.is_connected()) {
return; return;
}
for (auto& app_id : app_ids) { for (auto& app_id : app_ids) {
apps::mojom::AppType app_type = cache_.GetAppType(app_id); apps::mojom::AppType app_type = cache_.GetAppType(app_id);
...@@ -313,6 +316,20 @@ void AppServiceProxy::OnPauseDialogClosed(apps::mojom::AppType app_type, ...@@ -313,6 +316,20 @@ void AppServiceProxy::OnPauseDialogClosed(apps::mojom::AppType app_type,
app_service_->PauseApp(app_type, app_id); app_service_->PauseApp(app_type, app_id);
} }
void AppServiceProxy::GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback) {
if (!app_service_.is_connected()) {
return;
}
// TODO(crbug.com/1038487): change to use below code to call
// AppService->GetMenuModel when GetMenuModel is added to mojom.
// apps::mojom::AppType app_type = cache_.GetAppType(app_id);
// app_service_->GetMenuModel(app_type, app_id, menu_type,
// std::move(callback));
}
void AppServiceProxy::OpenNativeSettings(const std::string& app_id) { void AppServiceProxy::OpenNativeSettings(const std::string& app_id) {
if (app_service_.is_connected()) { if (app_service_.is_connected()) {
cache_.ForOneApp(app_id, [this](const apps::AppUpdate& update) { cache_.ForOneApp(app_id, [this](const apps::AppUpdate& update) {
......
...@@ -57,6 +57,8 @@ class AppServiceProxy : public KeyedService, ...@@ -57,6 +57,8 @@ class AppServiceProxy : public KeyedService,
public apps::mojom::Subscriber, public apps::mojom::Subscriber,
public apps::AppRegistryCache::Observer { public apps::AppRegistryCache::Observer {
public: public:
using GetMenuModelCallback =
base::OnceCallback<void(apps::mojom::MenuItemsPtr)>;
using OnPauseDialogClosedCallback = base::OnceCallback<void()>; using OnPauseDialogClosedCallback = base::OnceCallback<void()>;
explicit AppServiceProxy(Profile* profile); explicit AppServiceProxy(Profile* profile);
...@@ -124,6 +126,11 @@ class AppServiceProxy : public KeyedService, ...@@ -124,6 +126,11 @@ class AppServiceProxy : public KeyedService,
void OnPauseDialogClosed(apps::mojom::AppType app_type, void OnPauseDialogClosed(apps::mojom::AppType app_type,
const std::string& app_id); const std::string& app_id);
// Returns the menu items for the given |app_id|.
void GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback);
void OpenNativeSettings(const std::string& app_id); void OpenNativeSettings(const std::string& app_id);
void FlushMojoCallsForTesting(); void FlushMojoCallsForTesting();
......
...@@ -487,6 +487,12 @@ void ArcApps::UnpauseApps(const std::string& app_id) { ...@@ -487,6 +487,12 @@ void ArcApps::UnpauseApps(const std::string& app_id) {
SetIconEffect(app_id); SetIconEffect(app_id);
} }
void ArcApps::GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback) {
std::move(callback).Run(apps::mojom::MenuItems::New());
}
void ArcApps::OpenNativeSettings(const std::string& app_id) { void ArcApps::OpenNativeSettings(const std::string& app_id) {
ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_); ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_);
if (!prefs) { if (!prefs) {
......
...@@ -52,6 +52,8 @@ class ArcApps : public KeyedService, ...@@ -52,6 +52,8 @@ class ArcApps : public KeyedService,
private: private:
using AppIdToTaskIds = std::map<std::string, std::set<int>>; using AppIdToTaskIds = std::map<std::string, std::set<int>>;
using GetMenuModelCallback =
base::OnceCallback<void(apps::mojom::MenuItemsPtr)>;
using TaskIdToAppId = std::map<int, std::string>; using TaskIdToAppId = std::map<int, std::string>;
ArcApps(Profile* profile, apps::AppServiceProxy* proxy); ArcApps(Profile* profile, apps::AppServiceProxy* proxy);
...@@ -84,6 +86,9 @@ class ArcApps : public KeyedService, ...@@ -84,6 +86,9 @@ class ArcApps : public KeyedService,
bool report_abuse) override; bool report_abuse) override;
void PauseApp(const std::string& app_id) override; void PauseApp(const std::string& app_id) override;
void UnpauseApps(const std::string& app_id) override; void UnpauseApps(const std::string& app_id) override;
void GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback);
void OpenNativeSettings(const std::string& app_id) override; void OpenNativeSettings(const std::string& app_id) override;
void OnPreferredAppSet(const std::string& app_id, void OnPreferredAppSet(const std::string& app_id,
apps::mojom::IntentFilterPtr intent_filter, apps::mojom::IntentFilterPtr intent_filter,
......
...@@ -11,9 +11,12 @@ ...@@ -11,9 +11,12 @@
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/apps/app_service/app_icon_factory.h" #include "chrome/browser/apps/app_service/app_icon_factory.h"
#include "chrome/browser/apps/app_service/app_service_metrics.h" #include "chrome/browser/apps/app_service/app_service_metrics.h"
#include "chrome/browser/apps/app_service/menu_util.h"
#include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/internal_app/internal_app_item.h" #include "chrome/browser/ui/app_list/internal_app/internal_app_item.h"
#include "chrome/browser/ui/app_list/internal_app/internal_app_metadata.h" #include "chrome/browser/ui/app_list/internal_app/internal_app_metadata.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/services/app_service/public/mojom/types.mojom.h" #include "chrome/services/app_service/public/mojom/types.mojom.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -186,6 +189,17 @@ void BuiltInChromeOsApps::UnpauseApps(const std::string& app_id) { ...@@ -186,6 +189,17 @@ void BuiltInChromeOsApps::UnpauseApps(const std::string& app_id) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
void BuiltInChromeOsApps::GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback) {
apps::mojom::MenuItemsPtr menu_items = apps::mojom::MenuItems::New();
if (app_id == plugin_vm::kPluginVmAppId) {
AddCommandItem(ash::STOP_APP, IDS_PLUGIN_VM_SHUT_DOWN_MENU_ITEM,
&menu_items);
}
std::move(callback).Run(std::move(menu_items));
}
void BuiltInChromeOsApps::OpenNativeSettings(const std::string& app_id) { void BuiltInChromeOsApps::OpenNativeSettings(const std::string& app_id) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
......
...@@ -31,6 +31,9 @@ class BuiltInChromeOsApps : public apps::mojom::Publisher { ...@@ -31,6 +31,9 @@ class BuiltInChromeOsApps : public apps::mojom::Publisher {
static bool SetHideSettingsAppForTesting(bool hide); static bool SetHideSettingsAppForTesting(bool hide);
private: private:
using GetMenuModelCallback =
base::OnceCallback<void(::apps::mojom::MenuItemsPtr)>;
void Initialize(const mojo::Remote<apps::mojom::AppService>& app_service); void Initialize(const mojo::Remote<apps::mojom::AppService>& app_service);
// apps::mojom::Publisher overrides. // apps::mojom::Publisher overrides.
...@@ -58,6 +61,9 @@ class BuiltInChromeOsApps : public apps::mojom::Publisher { ...@@ -58,6 +61,9 @@ class BuiltInChromeOsApps : public apps::mojom::Publisher {
bool report_abuse) override; bool report_abuse) override;
void PauseApp(const std::string& app_id) override; void PauseApp(const std::string& app_id) override;
void UnpauseApps(const std::string& app_id) override; void UnpauseApps(const std::string& app_id) override;
void GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback);
void OpenNativeSettings(const std::string& app_id) override; void OpenNativeSettings(const std::string& app_id) override;
void OnPreferredAppSet(const std::string& app_id, void OnPreferredAppSet(const std::string& app_id,
apps::mojom::IntentFilterPtr intent_filter, apps::mojom::IntentFilterPtr intent_filter,
......
...@@ -172,6 +172,12 @@ void CrostiniApps::UnpauseApps(const std::string& app_id) { ...@@ -172,6 +172,12 @@ void CrostiniApps::UnpauseApps(const std::string& app_id) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
void CrostiniApps::GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback) {
std::move(callback).Run(apps::mojom::MenuItems::New());
}
void CrostiniApps::OpenNativeSettings(const std::string& app_id) { void CrostiniApps::OpenNativeSettings(const std::string& app_id) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
......
...@@ -43,6 +43,9 @@ class CrostiniApps : public KeyedService, ...@@ -43,6 +43,9 @@ class CrostiniApps : public KeyedService,
Profile* profile); Profile* profile);
private: private:
using GetMenuModelCallback =
base::OnceCallback<void(apps::mojom::MenuItemsPtr)>;
enum class PublishAppIDType { enum class PublishAppIDType {
kInstall, kInstall,
kUninstall, kUninstall,
...@@ -76,6 +79,9 @@ class CrostiniApps : public KeyedService, ...@@ -76,6 +79,9 @@ class CrostiniApps : public KeyedService,
bool report_abuse) override; bool report_abuse) override;
void PauseApp(const std::string& app_id) override; void PauseApp(const std::string& app_id) override;
void UnpauseApps(const std::string& app_id) override; void UnpauseApps(const std::string& app_id) override;
void GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback);
void OpenNativeSettings(const std::string& app_id) override; void OpenNativeSettings(const std::string& app_id) override;
void OnPreferredAppSet(const std::string& app_id, void OnPreferredAppSet(const std::string& app_id,
apps::mojom::IntentFilterPtr intent_filter, apps::mojom::IntentFilterPtr intent_filter,
......
...@@ -638,6 +638,12 @@ void ExtensionApps::UnpauseApps(const std::string& app_id) { ...@@ -638,6 +638,12 @@ void ExtensionApps::UnpauseApps(const std::string& app_id) {
web_limit->ResumeWebActivity(app_id); web_limit->ResumeWebActivity(app_id);
} }
void ExtensionApps::GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback) {
std::move(callback).Run(apps::mojom::MenuItems::New());
}
void ExtensionApps::OpenNativeSettings(const std::string& app_id) { void ExtensionApps::OpenNativeSettings(const std::string& app_id) {
if (!profile_) { if (!profile_) {
return; return;
......
...@@ -72,6 +72,9 @@ class ExtensionApps : public apps::mojom::Publisher, ...@@ -72,6 +72,9 @@ class ExtensionApps : public apps::mojom::Publisher,
void ObserveArc(); void ObserveArc();
private: private:
using GetMenuModelCallback =
base::OnceCallback<void(apps::mojom::MenuItemsPtr)>;
void Initialize(const mojo::Remote<apps::mojom::AppService>& app_service); void Initialize(const mojo::Remote<apps::mojom::AppService>& app_service);
// Determines whether the given extension should be treated as type app_type_, // Determines whether the given extension should be treated as type app_type_,
...@@ -103,6 +106,9 @@ class ExtensionApps : public apps::mojom::Publisher, ...@@ -103,6 +106,9 @@ class ExtensionApps : public apps::mojom::Publisher,
bool report_abuse) override; bool report_abuse) override;
void PauseApp(const std::string& app_id) override; void PauseApp(const std::string& app_id) override;
void UnpauseApps(const std::string& app_id) override; void UnpauseApps(const std::string& app_id) override;
void GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback);
void OpenNativeSettings(const std::string& app_id) override; void OpenNativeSettings(const std::string& app_id) override;
void OnPreferredAppSet(const std::string& app_id, void OnPreferredAppSet(const std::string& app_id,
apps::mojom::IntentFilterPtr intent_filter, apps::mojom::IntentFilterPtr intent_filter,
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/apps/app_service/menu_util.h"
namespace {
int kInvalidRadioGroupId = -1;
}
namespace apps {
void AddCommandItem(uint32_t command_id,
uint32_t string_id,
apps::mojom::MenuItemsPtr* menu_items) {
apps::mojom::MenuItemPtr menu_item = apps::mojom::MenuItem::New();
menu_item->type = apps::mojom::MenuItemType::kCommand;
menu_item->command_id = command_id;
menu_item->string_id = string_id;
menu_item->radio_group_id = kInvalidRadioGroupId;
(*menu_items)->items.push_back(menu_item.Clone());
}
} // namespace apps
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_APPS_APP_SERVICE_MENU_UTIL_H_
#define CHROME_BROWSER_APPS_APP_SERVICE_MENU_UTIL_H_
#include "chrome/services/app_service/public/mojom/types.mojom.h"
namespace apps {
void AddCommandItem(uint32_t command_id,
uint32_t string_id,
apps::mojom::MenuItemsPtr* menu_items);
} // namespace apps
#endif // CHROME_BROWSER_APPS_APP_SERVICE_MENU_UTIL_H_
...@@ -348,6 +348,12 @@ void WebApps::UnpauseApps(const std::string& app_id) { ...@@ -348,6 +348,12 @@ void WebApps::UnpauseApps(const std::string& app_id) {
SetIconEffect(app_id); SetIconEffect(app_id);
} }
void WebApps::GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback) {
std::move(callback).Run(apps::mojom::MenuItems::New());
}
void WebApps::OpenNativeSettings(const std::string& app_id) { void WebApps::OpenNativeSettings(const std::string& app_id) {
if (!profile_) { if (!profile_) {
return; return;
......
...@@ -53,6 +53,9 @@ class WebApps : public apps::mojom::Publisher, ...@@ -53,6 +53,9 @@ class WebApps : public apps::mojom::Publisher,
void ObserveArc(); void ObserveArc();
private: private:
using GetMenuModelCallback =
base::OnceCallback<void(apps::mojom::MenuItemsPtr)>;
void Initialize(const mojo::Remote<apps::mojom::AppService>& app_service); void Initialize(const mojo::Remote<apps::mojom::AppService>& app_service);
const web_app::WebApp* GetWebApp(const web_app::AppId& app_id) const; const web_app::WebApp* GetWebApp(const web_app::AppId& app_id) const;
...@@ -83,6 +86,9 @@ class WebApps : public apps::mojom::Publisher, ...@@ -83,6 +86,9 @@ class WebApps : public apps::mojom::Publisher,
bool report_abuse) override; bool report_abuse) override;
void PauseApp(const std::string& app_id) override; void PauseApp(const std::string& app_id) override;
void UnpauseApps(const std::string& app_id) override; void UnpauseApps(const std::string& app_id) override;
void GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback);
void OpenNativeSettings(const std::string& app_id) override; void OpenNativeSettings(const std::string& app_id) override;
void OnPreferredAppSet(const std::string& app_id, void OnPreferredAppSet(const std::string& app_id,
apps::mojom::IntentFilterPtr intent_filter, apps::mojom::IntentFilterPtr intent_filter,
......
...@@ -184,6 +184,21 @@ void AppServiceImpl::UnpauseApps(apps::mojom::AppType app_type, ...@@ -184,6 +184,21 @@ void AppServiceImpl::UnpauseApps(apps::mojom::AppType app_type,
iter->second->UnpauseApps(app_id); iter->second->UnpauseApps(app_id);
} }
void AppServiceImpl::GetMenuModel(apps::mojom::AppType app_type,
const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback) {
auto iter = publishers_.find(app_type);
if (iter == publishers_.end()) {
std::move(callback).Run(apps::mojom::MenuItems::New());
return;
}
// TODO(crbug.com/1038487): change to use below code to call
// AppServiceProxy->GetMenuModel when GetMenuModel is added to mojom.
// iter->second->GetMenuModel(app_id, menu_type, std::move(callback));
}
void AppServiceImpl::OpenNativeSettings(apps::mojom::AppType app_type, void AppServiceImpl::OpenNativeSettings(apps::mojom::AppType app_type,
const std::string& app_id) { const std::string& app_id) {
auto iter = publishers_.find(app_type); auto iter = publishers_.find(app_type);
......
...@@ -27,6 +27,9 @@ namespace apps { ...@@ -27,6 +27,9 @@ namespace apps {
// See chrome/services/app_service/README.md. // See chrome/services/app_service/README.md.
class AppServiceImpl : public apps::mojom::AppService { class AppServiceImpl : public apps::mojom::AppService {
public: public:
using GetMenuModelCallback =
base::OnceCallback<void(apps::mojom::MenuItemsPtr)>;
explicit AppServiceImpl(PrefService* profile_prefs); explicit AppServiceImpl(PrefService* profile_prefs);
~AppServiceImpl() override; ~AppServiceImpl() override;
...@@ -73,6 +76,10 @@ class AppServiceImpl : public apps::mojom::AppService { ...@@ -73,6 +76,10 @@ class AppServiceImpl : public apps::mojom::AppService {
const std::string& app_id) override; const std::string& app_id) override;
void UnpauseApps(apps::mojom::AppType app_type, void UnpauseApps(apps::mojom::AppType app_type,
const std::string& app_id) override; const std::string& app_id) override;
void GetMenuModel(apps::mojom::AppType app_type,
const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback);
void OpenNativeSettings(apps::mojom::AppType app_type, void OpenNativeSettings(apps::mojom::AppType app_type,
const std::string& app_id) override; const std::string& app_id) override;
void AddPreferredApp(apps::mojom::AppType app_type, void AddPreferredApp(apps::mojom::AppType app_type,
......
...@@ -95,6 +95,13 @@ class FakePublisher : public apps::mojom::Publisher { ...@@ -95,6 +95,13 @@ class FakePublisher : public apps::mojom::Publisher {
void Uninstall(const std::string& app_id, void Uninstall(const std::string& app_id,
bool clear_site_data, bool clear_site_data,
bool report_abuse) override {} bool report_abuse) override {}
using GetMenuModelCallback =
base::OnceCallback<void(apps::mojom::MenuItemsPtr)>;
void GetMenuModel(const std::string& app_id,
apps::mojom::MenuType menu_type,
GetMenuModelCallback callback) {}
void PauseApp(const std::string& app_id) override {} void PauseApp(const std::string& app_id) override {}
void UnpauseApps(const std::string& app_id) override {} void UnpauseApps(const std::string& app_id) override {}
......
...@@ -195,6 +195,40 @@ enum PermissionValueType { ...@@ -195,6 +195,40 @@ enum PermissionValueType {
kTriState, // Permission.value is a TriState. kTriState, // Permission.value is a TriState.
}; };
// MenuItems are used to populate context menus, e.g. in the app list or shelf.
// Note: Some menu item types only support a subset of these item features.
// Please update comments below (MenuItemType -> [fields expected for usage])
// when anything changed to MenuItemType or MenuItem.
//
// kCommand -> [command_id, string_id].
// kRadio -> [command_id, string_id, radio_group_id].
// kSubmenu -> [command_id, string_id, submenu].
//
struct MenuItems {
array<MenuItem> items;
};
struct MenuItem {
MenuItemType type; // The type of the menu item.
int32 command_id; // The menu item command id.
int32 string_id; // The id of the menu item label.
array<MenuItem> submenu; // The optional nested submenu item list.
int32 radio_group_id; // The radio group id.
};
// The types of menu items shown in the app list or shelf.
enum MenuItemType {
kCommand, // Performs an action when selected.
kRadio, // Can be selected/checked among a group of choices.
kSubmenu, // Presents a submenu within another menu.
};
// Which component requests context menus, the app list or shelf.
enum MenuType {
kAppList,
kShelf,
};
// The intent filter matching condition types. // The intent filter matching condition types.
enum ConditionType { enum ConditionType {
kScheme, // Matches the URL scheme (e.g. https, tel). kScheme, // Matches the URL scheme (e.g. https, tel).
......
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