Commit bd979bb6 authored by Alexey Baskakov's avatar Alexey Baskakov Committed by Commit Bot

AppService: Remove kDesktopPWAsWithoutExtensions flag usage.

Also remove extensions_web_apps_ provider.

This CL introduces no behavior changes.

In next CL: Clean up ExtensionApps class as if it manages kExtension
apps only.

Bug: 1065748
Change-Id: Ibb2a41db9d0ed23ff4d5d572298dc29a02515077
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2520476Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Commit-Queue: Alexey Baskakov <loyso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824644}
parent 1f4bbd3d
......@@ -189,21 +189,10 @@ void AppServiceProxy::Initialize() {
lacros_apps_ = std::make_unique<LacrosApps>(app_service_);
}
}
if (base::FeatureList::IsEnabled(features::kDesktopPWAsWithoutExtensions)) {
web_apps_ = std::make_unique<WebAppsChromeOs>(app_service_, profile_,
&instance_registry_);
} else {
extension_web_apps_ = std::make_unique<ExtensionAppsChromeOs>(
app_service_, profile_, apps::mojom::AppType::kWeb,
&instance_registry_);
}
web_apps_ = std::make_unique<WebAppsChromeOs>(app_service_, profile_,
&instance_registry_);
#else
if (base::FeatureList::IsEnabled(features::kDesktopPWAsWithoutExtensions)) {
web_apps_ = std::make_unique<WebApps>(app_service_, profile_);
} else {
extension_web_apps_ = std::make_unique<ExtensionApps>(
app_service_, profile_, apps::mojom::AppType::kWeb);
}
web_apps_ = std::make_unique<WebApps>(app_service_, profile_);
extension_apps_ = std::make_unique<ExtensionApps>(
app_service_, profile_, apps::mojom::AppType::kExtension);
#endif
......@@ -377,12 +366,7 @@ void AppServiceProxy::Uninstall(const std::string& app_id,
// On non-ChromeOS, publishers run the remove dialog.
apps::mojom::AppType app_type = cache_.GetAppType(app_id);
if (app_type == apps::mojom::AppType::kWeb) {
if (!base::FeatureList::IsEnabled(
features::kDesktopPWAsWithoutExtensions)) {
ExtensionApps::UninstallImpl(profile_, app_id, parent_window);
} else {
WebApps::UninstallImpl(profile_, app_id, parent_window);
}
WebApps::UninstallImpl(profile_, app_id, parent_window);
}
#endif
}
......@@ -505,8 +489,6 @@ void AppServiceProxy::FlushMojoCallsForTesting() {
}
if (web_apps_) {
web_apps_->FlushMojoCallsForTesting();
} else {
extension_web_apps_->FlushMojoCallsForTesting();
}
if (borealis_apps_) {
borealis_apps_->FlushMojoCallsForTesting();
......@@ -616,8 +598,6 @@ void AppServiceProxy::SetArcIsRegistered() {
extension_apps_->ObserveArc();
if (web_apps_) {
web_apps_->ObserveArc();
} else {
extension_web_apps_->ObserveArc();
}
#endif
}
......@@ -662,8 +642,6 @@ void AppServiceProxy::Shutdown() {
extension_apps_->Shutdown();
if (web_apps_) {
web_apps_->Shutdown();
} else {
extension_web_apps_->Shutdown();
}
}
borealis_apps_.reset();
......
......@@ -425,9 +425,6 @@ class AppServiceProxy : public KeyedService,
std::unique_ptr<ExtensionAppsChromeOs> extension_apps_;
std::unique_ptr<PluginVmApps> plugin_vm_apps_;
std::unique_ptr<LacrosApps> lacros_apps_;
// TODO(crbug.com/877898): Erase extension_web_apps_. One of these is always
// nullptr.
std::unique_ptr<ExtensionAppsChromeOs> extension_web_apps_;
std::unique_ptr<WebAppsChromeOs> web_apps_;
std::unique_ptr<BorealisApps> borealis_apps_;
......
......@@ -115,7 +115,9 @@ void WebAppsBase::Shutdown() {
const web_app::WebApp* WebAppsBase::GetWebApp(
const web_app::AppId& app_id) const {
return GetRegistrar()->GetAppById(app_id);
// GetRegistrar() might return nullptr if the legacy bookmark apps registry is
// enabled. This may happen in migration browser tests.
return GetRegistrar() ? GetRegistrar()->GetAppById(app_id) : nullptr;
}
void WebAppsBase::OnWebAppUninstalled(const web_app::AppId& app_id) {
......
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