Remove the kAppServiceOnAppUpdateWithoutMojom flag PIII.
The kAppServiceOnAppUpdateWithoutMojom flag is enabled in M102. So it
can be removed in M106.
This is pure refactor and no function change.
BUG=1253250
Change-Id: I6d61334ddc4320c78337c654d3e4ebfb477bb344
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3779872
Reviewed-by: Dominick Ng <[email protected]>
Reviewed-by: Yanzhu Du <[email protected]>
Commit-Queue: Nancy Wang <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1028026}
diff --git a/chrome/browser/ash/accessibility/spoken_feedback_browsertest.cc b/chrome/browser/ash/accessibility/spoken_feedback_browsertest.cc
index f9df3fd..c1f5ece 100644
--- a/chrome/browser/ash/accessibility/spoken_feedback_browsertest.cc
+++ b/chrome/browser/ash/accessibility/spoken_feedback_browsertest.cc
@@ -51,7 +51,6 @@
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/user_manager/user_names.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
@@ -567,23 +566,13 @@
app->readiness = apps::Readiness::kReady;
app->paused = true;
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> apps;
- apps.push_back(std::move(app));
- apps::AppServiceProxyFactory::GetForProfile(
- AccessibilityManager::Get()->profile())
- ->AppRegistryCache()
- .OnApps(std::move(apps), apps::AppType::kBuiltIn,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_apps;
- mojom_apps.push_back(apps::ConvertAppToMojomApp(app));
- apps::AppServiceProxyFactory::GetForProfile(
- AccessibilityManager::Get()->profile())
- ->AppRegistryCache()
- .OnApps(std::move(mojom_apps), apps::mojom::AppType::kBuiltIn,
- false /* should_notify_initialized */);
- }
+ std::vector<apps::AppPtr> apps;
+ apps.push_back(std::move(app));
+ apps::AppServiceProxyFactory::GetForProfile(
+ AccessibilityManager::Get()->profile())
+ ->AppRegistryCache()
+ .OnApps(std::move(apps), apps::AppType::kBuiltIn,
+ false /* should_notify_initialized */);
// Create and add a test app to the shelf model.
ShelfItem item;
@@ -627,23 +616,13 @@
apps::AppPtr app =
std::make_unique<apps::App>(apps::AppType::kBuiltIn, app_id);
app->readiness = apps::Readiness::kDisabledByPolicy;
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> apps;
- apps.push_back(std::move(app));
- apps::AppServiceProxyFactory::GetForProfile(
- AccessibilityManager::Get()->profile())
- ->AppRegistryCache()
- .OnApps(std::move(apps), apps::AppType::kBuiltIn,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_apps;
- mojom_apps.push_back(apps::ConvertAppToMojomApp(app));
- apps::AppServiceProxyFactory::GetForProfile(
- AccessibilityManager::Get()->profile())
- ->AppRegistryCache()
- .OnApps(std::move(mojom_apps), apps::mojom::AppType::kBuiltIn,
- false /* should_notify_initialized */);
- }
+ std::vector<apps::AppPtr> apps;
+ apps.push_back(std::move(app));
+ apps::AppServiceProxyFactory::GetForProfile(
+ AccessibilityManager::Get()->profile())
+ ->AppRegistryCache()
+ .OnApps(std::move(apps), apps::AppType::kBuiltIn,
+ false /* should_notify_initialized */);
// Create and add a test app to the shelf model.
ShelfItem item;
diff --git a/chrome/browser/ash/app_restore/full_restore_app_launch_handler_browsertest.cc b/chrome/browser/ash/app_restore/full_restore_app_launch_handler_browsertest.cc
index 0560167..17f4144 100644
--- a/chrome/browser/ash/app_restore/full_restore_app_launch_handler_browsertest.cc
+++ b/chrome/browser/ash/app_restore/full_restore_app_launch_handler_browsertest.cc
@@ -68,7 +68,6 @@
#include "components/prefs/pref_registry_simple.h"
#include "components/services/app_service/public/cpp/app_launch_util.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/mojom/types.mojom.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/test/browser_test.h"
@@ -2307,19 +2306,10 @@
app->readiness = readiness;
auto* proxy = apps::AppServiceProxyFactory::GetForProfile(profile());
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> deltas;
- deltas.push_back(std::move(app));
- proxy->AppRegistryCache().OnApps(std::move(deltas), apps::AppType::kArc,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(app));
- proxy->AppRegistryCache().OnApps(std::move(mojom_deltas),
- apps::mojom::AppType::kArc,
- false /* should_notify_initialized */);
- }
+ std::vector<apps::AppPtr> deltas;
+ deltas.push_back(std::move(app));
+ proxy->AppRegistryCache().OnApps(std::move(deltas), apps::AppType::kArc,
+ false /* should_notify_initialized */);
}
void RemoveApp(const std::string& app_id) {
@@ -2327,19 +2317,10 @@
app->readiness = apps::Readiness::kUninstalledByUser;
auto* proxy = apps::AppServiceProxyFactory::GetForProfile(profile());
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> deltas;
- deltas.push_back(std::move(app));
- proxy->AppRegistryCache().OnApps(std::move(deltas), apps::AppType::kArc,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(app));
- proxy->AppRegistryCache().OnApps(std::move(mojom_deltas),
- apps::mojom::AppType::kArc,
- false /* should_notify_initialized */);
- }
+ std::vector<apps::AppPtr> deltas;
+ deltas.push_back(std::move(app));
+ proxy->AppRegistryCache().OnApps(std::move(deltas), apps::AppType::kArc,
+ false /* should_notify_initialized */);
}
bool HasRestoreData() {
@@ -2813,19 +2794,10 @@
app_type,
*GetManager().GetAppIdForSystemApp(ash::SystemWebAppType::HELP));
app->readiness = readiness;
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> deltas;
- deltas.push_back(std::move(app));
- cache.OnApps(std::move(deltas), app_type,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(app));
- cache.OnApps(std::move(mojom_deltas),
- apps::ConvertAppTypeToMojomAppType(app_type),
- false /* should_notify_initialized */);
- }
+ std::vector<apps::AppPtr> deltas;
+ deltas.push_back(std::move(app));
+ cache.OnApps(std::move(deltas), app_type,
+ false /* should_notify_initialized */);
}
void SetShouldRestore(FullRestoreAppLaunchHandler* app_launch_handler) {
diff --git a/chrome/browser/ash/child_accounts/family_user_app_metrics_unittest.cc b/chrome/browser/ash/child_accounts/family_user_app_metrics_unittest.cc
index a984017..7f010ee4 100644
--- a/chrome/browser/ash/child_accounts/family_user_app_metrics_unittest.cc
+++ b/chrome/browser/ash/child_accounts/family_user_app_metrics_unittest.cc
@@ -19,7 +19,6 @@
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/cpp/instance.h"
#include "components/services/app_service/public/cpp/instance_registry.h"
#include "components/services/app_service/public/mojom/types.mojom.h"
@@ -190,18 +189,8 @@
deltas.push_back(MakeApp(/*app_id=*/"s", /*app_name=*/"systemweb",
/*last_launch_time=*/base::Time::Now(),
apps::AppType::kSystemWeb));
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- cache.OnApps(std::move(deltas), apps::AppType::kUnknown,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- for (const auto& delta : deltas) {
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(delta));
- }
- cache.OnApps(std::move(mojom_deltas), apps::mojom::AppType::kUnknown,
- false /* should_notify_initialized */);
- }
+ cache.OnApps(std::move(deltas), apps::AppType::kUnknown,
+ false /* should_notify_initialized */);
apps::InstanceRegistry& instance_registry =
apps::AppServiceProxyFactory::GetForProfile(profile())
diff --git a/chrome/browser/ash/file_manager/app_service_file_tasks_unittest.cc b/chrome/browser/ash/file_manager/app_service_file_tasks_unittest.cc
index 8697bdd..08efb58 100644
--- a/chrome/browser/ash/file_manager/app_service_file_tasks_unittest.cc
+++ b/chrome/browser/ash/file_manager/app_service_file_tasks_unittest.cc
@@ -19,7 +19,6 @@
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/test/base/testing_profile.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/cpp/intent_filter.h"
#include "components/services/app_service/public/cpp/intent_test_util.h"
#include "components/services/app_service/public/cpp/intent_util.h"
@@ -121,18 +120,8 @@
app->readiness = apps::Readiness::kReady;
app->intent_filters = std::move(intent_filters);
apps.push_back(std::move(app));
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- app_service_proxy_->AppRegistryCache().OnApps(
- std::move(apps), app_type, false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_apps;
- mojom_apps.push_back(apps::ConvertAppToMojomApp(apps[0]));
- app_service_proxy_->AppRegistryCache().OnApps(
- std::move(mojom_apps), apps::ConvertAppTypeToMojomAppType(app_type),
- /*should_notify_initialized=*/false);
- app_service_test_.WaitForAppService();
- }
+ app_service_proxy_->AppRegistryCache().OnApps(
+ std::move(apps), app_type, false /* should_notify_initialized */);
}
void AddFakeWebApp(const std::string& app_id,
diff --git a/chrome/browser/ash/policy/status_collector/app_info_generator_unittest.cc b/chrome/browser/ash/policy/status_collector/app_info_generator_unittest.cc
index 63d4fb4..8ef3e57 100644
--- a/chrome/browser/ash/policy/status_collector/app_info_generator_unittest.cc
+++ b/chrome/browser/ash/policy/status_collector/app_info_generator_unittest.cc
@@ -28,7 +28,6 @@
#include "chrome/test/base/testing_profile.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/session_manager/core/session_manager.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "components/user_manager/scoped_user_manager.h"
@@ -143,19 +142,10 @@
protected:
void PushApp(apps::AppPtr app) {
apps::AppType app_type = app->app_type;
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> deltas;
- deltas.push_back(std::move(app));
- GetCache().OnApps(std::move(deltas), app_type,
- /*should_notify_initialized=*/false);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(app));
- GetCache().OnApps(std::move(mojom_deltas),
- apps::ConvertAppTypeToMojomAppType(app_type),
- /*should_notify_initialized=*/true);
- }
+ std::vector<apps::AppPtr> deltas;
+ deltas.push_back(std::move(app));
+ GetCache().OnApps(std::move(deltas), app_type,
+ /*should_notify_initialized=*/false);
}
void PushApp(const std::string& app_id,
diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc
index 28a9e7f..52c7861 100644
--- a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc
+++ b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc
@@ -98,7 +98,6 @@
#include "components/prefs/testing_pref_service.h"
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/session_manager/core/session_manager.h"
#include "components/upload_list/upload_list.h"
#include "components/user_manager/scoped_user_manager.h"
@@ -3732,21 +3731,11 @@
apps::AppServiceProxyFactory::GetForProfile(testing_profile_.get());
auto app1 = std::make_unique<apps::App>(apps::AppType::kChromeApp, "id");
auto app2 = std::make_unique<apps::App>(apps::AppType::kChromeApp, "id2");
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> apps;
- apps.push_back(std::move(app1));
- apps.push_back(std::move(app2));
- app_proxy->AppRegistryCache().OnApps(std::move(apps),
- apps::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(app1));
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(app2));
- app_proxy->AppRegistryCache().OnApps(std::move(mojom_deltas),
- apps::mojom::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- }
+ std::vector<apps::AppPtr> apps;
+ apps.push_back(std::move(app1));
+ apps.push_back(std::move(app2));
+ app_proxy->AppRegistryCache().OnApps(std::move(apps), apps::AppType::kUnknown,
+ /*should_notify_initialized=*/false);
// Start app instance
base::Time start_time;
diff --git a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc
index 7da3561..79c0d88 100644
--- a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc
+++ b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc
@@ -94,7 +94,6 @@
#include "components/prefs/pref_service.h"
#include "components/prefs/testing_pref_service.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/session_manager/core/session_manager.h"
#include "components/upload_list/upload_list.h"
#include "components/user_manager/scoped_user_manager.h"
@@ -3724,21 +3723,11 @@
apps::AppServiceProxyFactory::GetForProfile(testing_profile_.get());
auto app1 = std::make_unique<apps::App>(apps::AppType::kChromeApp, "id");
auto app2 = std::make_unique<apps::App>(apps::AppType::kChromeApp, "id2");
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> apps;
- apps.push_back(std::move(app1));
- apps.push_back(std::move(app2));
- app_proxy->AppRegistryCache().OnApps(std::move(apps),
- apps::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(app1));
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(app2));
- app_proxy->AppRegistryCache().OnApps(std::move(mojom_deltas),
- apps::mojom::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- }
+ std::vector<apps::AppPtr> apps;
+ apps.push_back(std::move(app1));
+ apps.push_back(std::move(app2));
+ app_proxy->AppRegistryCache().OnApps(std::move(apps), apps::AppType::kUnknown,
+ /*should_notify_initialized=*/false);
// Start app instance
base::Time start_time;
diff --git a/chrome/browser/ash/web_applications/media_app/media_app_integration_browsertest.cc b/chrome/browser/ash/web_applications/media_app/media_app_integration_browsertest.cc
index 4eb6d322..f10b08e 100644
--- a/chrome/browser/ash/web_applications/media_app/media_app_integration_browsertest.cc
+++ b/chrome/browser/ash/web_applications/media_app/media_app_integration_browsertest.cc
@@ -208,20 +208,11 @@
void InstallPhotosApp(Profile* profile) {
auto* proxy = apps::AppServiceProxyFactory::GetForProfile(profile);
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> registry_deltas;
- registry_deltas.push_back(MakePhotosApp());
- proxy->AppRegistryCache().OnApps(std::move(registry_deltas),
- apps::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(MakePhotosApp()));
- proxy->AppRegistryCache().OnApps(std::move(mojom_deltas),
- apps::mojom::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- }
+ std::vector<apps::AppPtr> registry_deltas;
+ registry_deltas.push_back(MakePhotosApp());
+ proxy->AppRegistryCache().OnApps(std::move(registry_deltas),
+ apps::AppType::kUnknown,
+ /*should_notify_initialized=*/false);
}
bool GetFlagInApp(content::WebContents* web_ui, const char* flag) {
diff --git a/chrome/browser/platform_util_unittest.cc b/chrome/browser/platform_util_unittest.cc
index ec364122..d02a17b 100644
--- a/chrome/browser/platform_util_unittest.cc
+++ b/chrome/browser/platform_util_unittest.cc
@@ -30,7 +30,6 @@
#include "chrome/browser/extensions/extension_special_storage_policy.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/cpp/intent_filter.h"
#include "content/public/browser/browser_context.h"
#include "content/public/common/content_client.h"
@@ -139,18 +138,9 @@
app->intent_filters =
apps_util::CreateIntentFiltersForChromeApp(extension.get());
apps.push_back(std::move(app));
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- app_service_proxy_->AppRegistryCache().OnApps(
- std::move(apps), apps::AppType::kChromeApp,
- /*should_notify_initialized=*/false);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_apps;
- mojom_apps.push_back(apps::ConvertAppToMojomApp(apps[0]));
- app_service_proxy_->AppRegistryCache().OnApps(
- std::move(mojom_apps), apps::mojom::AppType::kChromeApp,
- /*should_notify_initialized=*/false);
- }
+ app_service_proxy_->AppRegistryCache().OnApps(
+ std::move(apps), apps::AppType::kChromeApp,
+ /*should_notify_initialized=*/false);
app_service_test_.WaitForAppService();
}
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service.cc b/chrome/browser/ui/app_list/app_list_syncable_service.cc
index 91e170d..ca20faa4 100644
--- a/chrome/browser/ui/app_list/app_list_syncable_service.cc
+++ b/chrome/browser/ui/app_list/app_list_syncable_service.cc
@@ -52,7 +52,6 @@
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_types.h"
#include "components/services/app_service/public/cpp/app_update.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/mojom/types.mojom.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/model/sync_change_processor.h"
@@ -131,21 +130,12 @@
std::make_unique<apps::App>(apps::AppType::kChromeApp, id);
delta->install_reason = apps::InstallReason::kDefault;
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> deltas;
- deltas.push_back(std::move(delta));
- apps::AppServiceProxyFactory::GetForProfile(profile)
- ->AppRegistryCache()
- .OnApps(std::move(deltas), apps::AppType::kChromeApp,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(delta));
- apps::AppServiceProxyFactory::GetForProfile(profile)
- ->AppRegistryCache()
- .OnApps(std::move(mojom_deltas), apps::mojom::AppType::kChromeApp,
- false /* should_notify_initialized */);
- }
+ std::vector<apps::AppPtr> deltas;
+ deltas.push_back(std::move(delta));
+ apps::AppServiceProxyFactory::GetForProfile(profile)
+ ->AppRegistryCache()
+ .OnApps(std::move(deltas), apps::AppType::kChromeApp,
+ false /* should_notify_initialized */);
}
bool IsUnRemovableDefaultApp(const std::string& id) {
diff --git a/chrome/browser/ui/app_list/app_service/app_service_app_item_browsertest.cc b/chrome/browser/ui/app_list/app_service/app_service_app_item_browsertest.cc
index 60bbc25..140e54ad4 100644
--- a/chrome/browser/ui/app_list/app_service/app_service_app_item_browsertest.cc
+++ b/chrome/browser/ui/app_list/app_service/app_service_app_item_browsertest.cc
@@ -30,7 +30,6 @@
#include "components/account_id/account_id.h"
#include "components/services/app_service/public/cpp/app_types.h"
#include "components/services/app_service/public/cpp/app_update.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/mojom/types.mojom.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
@@ -51,21 +50,12 @@
block ? apps::Readiness::kDisabledByPolicy : apps::Readiness::kReady;
app->paused = pause;
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> apps;
- apps.push_back(std::move(app));
- apps::AppServiceProxyFactory::GetForProfile(profile)
- ->AppRegistryCache()
- .OnApps(std::move(apps), apps::AppType::kChromeApp,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(app));
- apps::AppServiceProxyFactory::GetForProfile(profile)
- ->AppRegistryCache()
- .OnApps(std::move(mojom_deltas), apps::mojom::AppType::kChromeApp,
- false /* should_notify_initialized */);
- }
+ std::vector<apps::AppPtr> apps;
+ apps.push_back(std::move(app));
+ apps::AppServiceProxyFactory::GetForProfile(profile)
+ ->AppRegistryCache()
+ .OnApps(std::move(apps), apps::AppType::kChromeApp,
+ false /* should_notify_initialized */);
}
void UpdateAppNameInRegistryCache(Profile* profile,
@@ -75,21 +65,12 @@
std::make_unique<apps::App>(apps::AppType::kChromeApp, app_id);
app->name = app_name;
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> apps;
- apps.push_back(std::move(app));
- apps::AppServiceProxyFactory::GetForProfile(profile)
- ->AppRegistryCache()
- .OnApps(std::move(apps), apps::AppType::kChromeApp,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(app));
- apps::AppServiceProxyFactory::GetForProfile(profile)
- ->AppRegistryCache()
- .OnApps(std::move(mojom_deltas), apps::mojom::AppType::kChromeApp,
- false /* should_notify_initialized */);
- }
+ std::vector<apps::AppPtr> apps;
+ apps.push_back(std::move(app));
+ apps::AppServiceProxyFactory::GetForProfile(profile)
+ ->AppRegistryCache()
+ .OnApps(std::move(apps), apps::AppType::kChromeApp,
+ false /* should_notify_initialized */);
}
ash::AppListItem* GetAppListItem(const std::string& id) {
diff --git a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
index d458cb3..48c1cfe 100644
--- a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
+++ b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc
@@ -48,7 +48,6 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "components/crx_file/id_util.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/cpp/icon_types.h"
#include "components/services/app_service/public/cpp/stub_icon_loader.h"
#include "components/services/app_service/public/mojom/types.mojom.h"
@@ -136,17 +135,8 @@
apps::AppPtr app = std::make_unique<apps::App>(app_type, app_id);
app->icon_key = std::move(*icon_key);
apps.push_back(std::move(app));
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- proxy.AppRegistryCache().OnApps(std::move(apps), apps::AppType::kUnknown,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_apps;
- mojom_apps.push_back(apps::ConvertAppToMojomApp(apps[0]));
- proxy.AppRegistryCache().OnApps(std::move(mojom_apps),
- apps::mojom::AppType::kUnknown,
- false /* should_notify_initialized */);
- proxy.FlushMojoCallsForTesting();
- }
+ proxy.AppRegistryCache().OnApps(std::move(apps), apps::AppType::kUnknown,
+ false /* should_notify_initialized */);
}
class AppSearchProviderTest : public AppListTestBase {
diff --git a/chrome/browser/ui/ash/app_access_notifier_unittest.cc b/chrome/browser/ui/ash/app_access_notifier_unittest.cc
index 59b5f75..25d9e0e 100644
--- a/chrome/browser/ui/ash/app_access_notifier_unittest.cc
+++ b/chrome/browser/ui/ash/app_access_notifier_unittest.cc
@@ -16,7 +16,6 @@
#include "components/services/app_service/public/cpp/app_registry_cache_wrapper.h"
#include "components/services/app_service/public/cpp/app_types.h"
#include "components/services/app_service/public/cpp/capability_access_update.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/user_manager/fake_user_manager.h"
#include "components/user_manager/scoped_user_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -151,16 +150,8 @@
std::vector<apps::AppPtr> registry_deltas;
registry_deltas.push_back(MakeApp(id, name));
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- reg_cache->OnApps(std::move(registry_deltas), apps::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(registry_deltas[0]));
- reg_cache->OnApps(std::move(mojom_deltas), apps::mojom::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- }
+ reg_cache->OnApps(std::move(registry_deltas), apps::AppType::kUnknown,
+ /*should_notify_initialized=*/false);
std::vector<apps::mojom::CapabilityAccessPtr> capability_access_deltas;
capability_access_deltas.push_back(MakeCapabilityAccess(
diff --git a/chrome/browser/ui/ash/media_client_impl_unittest.cc b/chrome/browser/ui/ash/media_client_impl_unittest.cc
index c0ecbb1..2fd47ced 100644
--- a/chrome/browser/ui/ash/media_client_impl_unittest.cc
+++ b/chrome/browser/ui/ash/media_client_impl_unittest.cc
@@ -18,7 +18,6 @@
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_registry_cache_wrapper.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/mojom/types.mojom-forward.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@@ -195,18 +194,8 @@
apps::mojom::OptionalBool use_camera) {
std::vector<apps::AppPtr> registry_deltas;
registry_deltas.push_back(MakeApp(id, name));
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- registry_cache_.OnApps(std::move(registry_deltas),
- apps::AppType::kUnknown,
- /* should_notify_initialized = */ false);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(registry_deltas[0]));
- registry_cache_.OnApps(std::move(mojom_deltas),
- apps::mojom::AppType::kUnknown,
- /* should_notify_initialized = */ false);
- }
+ registry_cache_.OnApps(std::move(registry_deltas), apps::AppType::kUnknown,
+ /* should_notify_initialized = */ false);
std::vector<apps::mojom::CapabilityAccessPtr> capability_access_deltas;
capability_access_deltas.push_back(MakeCapabilityAccess(id, use_camera));
diff --git a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_browsertest.cc b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_browsertest.cc
index 9b9f737..e3b7e69 100644
--- a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_browsertest.cc
+++ b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_browsertest.cc
@@ -44,7 +44,6 @@
#include "chrome/test/base/ui_test_utils.h"
#include "components/app_constants/constants.h"
#include "components/exo/shell_surface_util.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/cpp/instance.h"
#include "components/services/app_service/public/cpp/instance_registry.h"
#include "content/public/test/browser_test.h"
@@ -459,20 +458,6 @@
app_service_proxy_->InstanceRegistry().GetInstances(app_id).size());
ASSERT_NE(-1, shelf_model()->ItemIndexByAppID(app_id));
- // With non mojom AppService, anonymous apps are published sync, so we don't
- // need to flush mojom calls and verify no title for shelf items.
- if (!base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- // Initially, anonymous apps haven't been published, as that is an
- // asynchronous operation. This means their shelf item has no title.
- EXPECT_TRUE(shelf_model()
- ->items()[shelf_model()->ItemIndexByAppID(app_id)]
- .title.empty());
-
- // Flushing calls here simulates the fraction-of-seconds delay between the
- // window appearing and its app being published.
- app_service_proxy_->FlushMojoCallsForTesting();
- }
-
// Now that the app is published, it will have a name based on the window title
EXPECT_EQ(
"foo",
diff --git a/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc b/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc
index 159aa05..0400ea7 100644
--- a/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc
+++ b/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc
@@ -132,12 +132,8 @@
#include "components/prefs/pref_service.h"
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/cpp/instance.h"
#include "components/services/app_service/public/cpp/instance_registry.h"
-#include "components/services/app_service/public/mojom/types.mojom-forward.h"
-#include "components/services/app_service/public/mojom/types.mojom-shared.h"
-#include "components/services/app_service/public/mojom/types.mojom.h"
#include "components/sync/base/model_type.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_user_settings.h"
@@ -392,19 +388,10 @@
apps.push_back(std::move(app));
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- apps::AppServiceProxyFactory::GetForProfile(profile)
- ->AppRegistryCache()
- .OnApps(std::move(apps), apps::AppType::kChromeApp,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_apps;
- mojom_apps.push_back(apps::ConvertAppToMojomApp(apps[0]));
- apps::AppServiceProxyFactory::GetForProfile(profile)
- ->AppRegistryCache()
- .OnApps(std::move(mojom_apps), apps::mojom::AppType::kChromeApp,
- false /* should_notify_initialized */);
- }
+ apps::AppServiceProxyFactory::GetForProfile(profile)
+ ->AppRegistryCache()
+ .OnApps(std::move(apps), apps::AppType::kChromeApp,
+ false /* should_notify_initialized */);
}
} // namespace
@@ -5145,19 +5132,10 @@
std::make_unique<apps::App>(apps::AppType::kChromeApp, extension1_->id());
app->show_in_shelf = false;
apps.push_back(std::move(app));
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- apps::AppServiceProxyFactory::GetForProfile(profile())
- ->AppRegistryCache()
- .OnApps(std::move(apps), apps::AppType::kChromeApp,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_apps;
- mojom_apps.push_back(apps::ConvertAppToMojomApp(apps[0]));
- apps::AppServiceProxyFactory::GetForProfile(profile())
- ->AppRegistryCache()
- .OnApps(std::move(mojom_apps), apps::mojom::AppType::kChromeApp,
- false /* should_notify_initialized */);
- }
+ apps::AppServiceProxyFactory::GetForProfile(profile())
+ ->AppRegistryCache()
+ .OnApps(std::move(apps), apps::AppType::kChromeApp,
+ false /* should_notify_initialized */);
InitShelfController();
EXPECT_EQ("Chrome, App2", GetPinnedAppStatus());
diff --git a/chrome/browser/ui/ash/system_tray_client_impl_browsertest.cc b/chrome/browser/ui/ash/system_tray_client_impl_browsertest.cc
index bf8f3d0..8d5ea92 100644
--- a/chrome/browser/ui/ash/system_tray_client_impl_browsertest.cc
+++ b/chrome/browser/ui/ash/system_tray_client_impl_browsertest.cc
@@ -46,7 +46,6 @@
#include "components/prefs/pref_service.h"
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/user_manager/known_user.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/web_contents.h"
@@ -442,20 +441,11 @@
apps::AppServiceProxyAsh* proxy =
apps::AppServiceProxyFactory::GetForProfile(profile);
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> registry_deltas;
- registry_deltas.push_back(MakeApp(app_id, name));
- proxy->AppRegistryCache().OnApps(std::move(registry_deltas),
- apps::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(MakeApp(app_id, name)));
- proxy->AppRegistryCache().OnApps(std::move(mojom_deltas),
- apps::mojom::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- }
+ std::vector<apps::AppPtr> registry_deltas;
+ registry_deltas.push_back(MakeApp(app_id, name));
+ proxy->AppRegistryCache().OnApps(std::move(registry_deltas),
+ apps::AppType::kUnknown,
+ /*should_notify_initialized=*/false);
}
protected:
diff --git a/chrome/browser/ui/views/intent_picker_bubble_view_browsertest_chromeos.cc b/chrome/browser/ui/views/intent_picker_bubble_view_browsertest_chromeos.cc
index c2071bb..567c5e8 100644
--- a/chrome/browser/ui/views/intent_picker_bubble_view_browsertest_chromeos.cc
+++ b/chrome/browser/ui/views/intent_picker_bubble_view_browsertest_chromeos.cc
@@ -39,12 +39,10 @@
#include "chrome/test/base/ui_test_utils.h"
#include "components/arc/test/fake_intent_helper_instance.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/cpp/icon_loader.h"
#include "components/services/app_service/public/cpp/intent_filter_util.h"
#include "components/services/app_service/public/cpp/intent_test_util.h"
#include "components/services/app_service/public/cpp/intent_util.h"
-#include "components/services/app_service/public/mojom/types.mojom.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/prerender_test_util.h"
#include "content/public/test/test_navigation_observer.h"
@@ -187,21 +185,11 @@
auto app = std::make_unique<apps::App>(apps::AppType::kArc, app_id);
app->name = app_name;
app->intent_filters.push_back(apps_util::MakeIntentFilterForUrlScope(url));
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- std::vector<apps::AppPtr> apps;
- apps.push_back(std::move(app));
- app_service_proxy_->AppRegistryCache().OnApps(
- std::move(apps), apps::AppType::kArc,
- false /* should_notify_initialized */);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_apps;
- mojom_apps.push_back(apps::ConvertAppToMojomApp(app));
- app_service_proxy_->AppRegistryCache().OnApps(
- std::move(mojom_apps), apps::mojom::AppType::kArc,
- false /* should_notify_initialized */);
- WaitForAppService();
- }
+ std::vector<apps::AppPtr> apps;
+ apps.push_back(std::move(app));
+ app_service_proxy_->AppRegistryCache().OnApps(
+ std::move(apps), apps::AppType::kArc,
+ false /* should_notify_initialized */);
return app_id;
}
diff --git a/chrome/browser/ui/webui/settings/ash/os_apps_page/app_notification_handler_unittest.cc b/chrome/browser/ui/webui/settings/ash/os_apps_page/app_notification_handler_unittest.cc
index 08d155b28..eff757e 100644
--- a/chrome/browser/ui/webui/settings/ash/os_apps_page/app_notification_handler_unittest.cc
+++ b/chrome/browser/ui/webui/settings/ash/os_apps_page/app_notification_handler_unittest.cc
@@ -16,7 +16,6 @@
#include "chrome/test/base/testing_profile.h"
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_types.h"
-#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/cpp/permission.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -146,17 +145,8 @@
void UpdateAppRegistryCache(std::vector<apps::AppPtr>& fake_apps,
apps::AppType app_type) {
- if (base::FeatureList::IsEnabled(
- apps::kAppServiceOnAppUpdateWithoutMojom)) {
- app_service_proxy_->AppRegistryCache().OnApps(std::move(fake_apps),
- app_type, false);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_apps;
- mojom_apps.push_back(apps::ConvertAppToMojomApp(fake_apps[0]));
- app_service_proxy_->AppRegistryCache().OnApps(
- std::move(mojom_apps), apps::mojom::AppType::kUnknown,
- /*should_notify_initialized=*/false);
- }
+ app_service_proxy_->AppRegistryCache().OnApps(std::move(fake_apps),
+ app_type, false);
}
bool CheckIfFakeAppInList(std::string fake_id) {
diff --git a/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc b/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc
index 1517811..101f560b 100644
--- a/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc
+++ b/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc
@@ -27,6 +27,7 @@
#include "chromeos/ash/components/network/network_state_handler.h"
#include "components/onc/onc_constants.h"
#include "components/prefs/pref_service.h"
+#include "components/services/app_service/public/cpp/features.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
index 14cea68..0ddcc77 100644
--- a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
+++ b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
@@ -61,8 +61,6 @@
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_types.h"
#include "components/services/app_service/public/cpp/app_update.h"
-#include "components/services/app_service/public/cpp/features.h"
-#include "components/services/app_service/public/mojom/types.mojom.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/browser/browsing_data_remover.h"
@@ -140,15 +138,8 @@
MakeApp(web_app::GenerateAppId(/*manifest_id=*/absl::nullopt, start_url),
apps::AppType::kWeb, start_url.spec(), apps::Readiness::kReady,
apps::InstallReason::kSync));
- if (base::FeatureList::IsEnabled(apps::kAppServiceOnAppUpdateWithoutMojom)) {
- cache.OnApps(std::move(deltas), apps::AppType::kWeb,
- /*should_notify_initialized=*/true);
- } else {
- std::vector<apps::mojom::AppPtr> mojom_deltas;
- mojom_deltas.push_back(apps::ConvertAppToMojomApp(deltas[0]));
- cache.OnApps(std::move(mojom_deltas), apps::mojom::AppType::kWeb,
- /*should_notify_initialized=*/true);
- }
+ cache.OnApps(std::move(deltas), apps::AppType::kWeb,
+ /*should_notify_initialized=*/true);
}
} // namespace