Commit a7c7613c authored by nancy's avatar nancy Committed by Commit Bot

Reland "Remove launch service."

This is a reland of d07c4196

TBR=ericwilligers@chromium.org
TBR=dominickn@chromium.org

Original change's description:
> Remove launch service.
>
> BUG=1061843
>
> Change-Id: I12efd2899403cb9cc5e9dafc04300a7156342ed9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2116156
> Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
> Reviewed-by: Nancy Wang <nancylingwang@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
> Reviewed-by: Dominick Ng <dominickn@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#756170}

Bug: 1061843
Change-Id: I020be92154b0f5fad0d45f1f5c83f2d8539684d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134036Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarEric Willigers <ericwilligers@chromium.org>
Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756556}
parent 9e060313
...@@ -3127,14 +3127,6 @@ jumbo_static_library("browser") { ...@@ -3127,14 +3127,6 @@ jumbo_static_library("browser") {
"apps/intent_helper/intent_picker_auto_display_service_factory.h", "apps/intent_helper/intent_picker_auto_display_service_factory.h",
"apps/intent_helper/page_transition_util.cc", "apps/intent_helper/page_transition_util.cc",
"apps/intent_helper/page_transition_util.h", "apps/intent_helper/page_transition_util.h",
"apps/launch_service/extension_app_launch_manager.cc",
"apps/launch_service/extension_app_launch_manager.h",
"apps/launch_service/launch_manager.cc",
"apps/launch_service/launch_manager.h",
"apps/launch_service/launch_service.cc",
"apps/launch_service/launch_service.h",
"apps/launch_service/launch_service_factory.cc",
"apps/launch_service/launch_service_factory.h",
"background/background_contents.cc", "background/background_contents.cc",
"background/background_contents.h", "background/background_contents.h",
"background/background_contents_service_observer.h", "background/background_contents_service_observer.h",
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/apps/app_service/app_launch_params.h"
#include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/apps/app_service/launch_utils.h"
#include "chrome/browser/apps/app_service/menu_util.h" #include "chrome/browser/apps/app_service/menu_util.h"
#include "chrome/browser/apps/launch_service/launch_service.h"
#include "chrome/browser/chromeos/arc/arc_util.h" #include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/chromeos/arc/arc_web_contents_data.h" #include "chrome/browser/chromeos/arc/arc_web_contents_data.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h" #include "chrome/browser/chromeos/crostini/crostini_util.h"
......
ericwilligers@chromium.org
loyso@chromium.org
The Launch Service provides browser-specific functions for launching
application.
For example, Chrome Apps (platform apps and legacy packaged apps),
and BMO-based Desktop PWAs can be launched using this service.
The intent is to merge LaunchService into the AppService,
specifically AppServiceProxy.
See `//chrome/services/app_service/README.md` for a description of the
App Service.
// Copyright 2019 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/launch_service/extension_app_launch_manager.h"
#include "base/feature_list.h"
#include "chrome/browser/apps/app_service/launch_utils.h"
#include "chrome/browser/apps/platform_apps/platform_app_launch.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/web_applications/web_app_launch_manager.h"
#include "chrome/common/chrome_features.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension.h"
namespace apps {
namespace {
void RecordBookmarkLaunch(Profile* profile, const std::string& app_id) {
const extensions::Extension* extension =
extensions::ExtensionRegistry::Get(profile)->GetInstalledExtension(
app_id);
if (extension && extension->from_bookmark())
web_app::RecordAppWindowLaunch(profile, app_id);
}
} // namespace
ExtensionAppLaunchManager::ExtensionAppLaunchManager(Profile* profile)
: LaunchManager(profile) {}
ExtensionAppLaunchManager::~ExtensionAppLaunchManager() = default;
content::WebContents* ExtensionAppLaunchManager::OpenApplication(
const AppLaunchParams& params) {
if (params.container == apps::mojom::LaunchContainer::kLaunchContainerWindow)
RecordBookmarkLaunch(profile(), params.app_id);
return ::OpenApplication(profile(), params);
}
} // namespace apps
// Copyright 2019 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_LAUNCH_SERVICE_EXTENSION_APP_LAUNCH_MANAGER_H_
#define CHROME_BROWSER_APPS_LAUNCH_SERVICE_EXTENSION_APP_LAUNCH_MANAGER_H_
#include "base/macros.h"
#include "chrome/browser/apps/launch_service/launch_manager.h"
#include "chrome/services/app_service/public/mojom/types.mojom.h"
namespace apps {
// Handles launch requests for extension-backed apps,
// including Chrome Apps (platform apps and legacy packaged apps) and hosted
// apps (including desktop PWAs until BMO is ready).
class ExtensionAppLaunchManager final : public LaunchManager {
public:
explicit ExtensionAppLaunchManager(Profile* profile);
~ExtensionAppLaunchManager() override;
// apps::LaunchManager:
content::WebContents* OpenApplication(const AppLaunchParams& params) override;
private:
DISALLOW_COPY_AND_ASSIGN(ExtensionAppLaunchManager);
};
} // namespace apps
#endif // CHROME_BROWSER_APPS_LAUNCH_SERVICE_EXTENSION_APP_LAUNCH_MANAGER_H_
// Copyright 2019 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/launch_service/launch_manager.h"
namespace apps {
LaunchManager::LaunchManager(Profile* profile) : profile_(profile) {}
LaunchManager::~LaunchManager() = default;
} // namespace apps
// Copyright 2019 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_LAUNCH_SERVICE_LAUNCH_MANAGER_H_
#define CHROME_BROWSER_APPS_LAUNCH_SERVICE_LAUNCH_MANAGER_H_
#include <string>
#include "base/macros.h"
#include "components/services/app_service/public/mojom/types.mojom.h"
class Profile;
namespace content {
class WebContents;
}
namespace apps {
struct AppLaunchParams;
// A LaunchManager handles launch requests for a given type of apps.
class LaunchManager {
public:
virtual ~LaunchManager();
// Open the application in a way specified by |params|.
virtual content::WebContents* OpenApplication(
const AppLaunchParams& params) = 0;
protected:
explicit LaunchManager(Profile*);
Profile* profile() { return profile_; }
private:
Profile* const profile_;
DISALLOW_COPY_AND_ASSIGN(LaunchManager);
};
} // namespace apps
#endif // CHROME_BROWSER_APPS_LAUNCH_SERVICE_LAUNCH_MANAGER_H_
// Copyright 2019 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/launch_service/launch_service.h"
#include "base/feature_list.h"
#include "chrome/browser/apps/app_service/app_launch_params.h"
#include "chrome/browser/apps/launch_service/extension_app_launch_manager.h"
#include "chrome/browser/apps/launch_service/launch_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/web_applications/web_app_launch_manager.h"
#include "chrome/common/chrome_features.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension.h"
namespace apps {
// static
LaunchService* LaunchService::Get(Profile* profile) {
return LaunchServiceFactory::GetForProfile(profile);
}
LaunchService::LaunchService(Profile* profile) : profile_(profile) {
DCHECK(profile_);
// LaunchService must have only one instance in original profile,
// apart from guest mode where the off-the-record profile is used.
DCHECK_EQ(profile_->IsGuestSession(), profile_->IsOffTheRecord());
extension_app_launch_manager_ =
std::make_unique<ExtensionAppLaunchManager>(profile);
if (base::FeatureList::IsEnabled(features::kDesktopPWAsWithoutExtensions) ||
base::FeatureList::IsEnabled(features::kDesktopPWAsUnifiedLaunch)) {
web_app_launch_manager_ =
std::make_unique<web_app::WebAppLaunchManager>(profile);
} else {
web_app_launch_manager_ =
std::make_unique<ExtensionAppLaunchManager>(profile);
}
}
LaunchService::~LaunchService() {}
content::WebContents* LaunchService::OpenApplication(
const AppLaunchParams& params) {
return GetLaunchManagerForApp(params.app_id).OpenApplication(params);
}
LaunchManager& LaunchService::GetLaunchManagerForApp(
const std::string& app_id) {
// --app old-style app shortcuts
if (app_id.empty())
return *extension_app_launch_manager_;
const extensions::Extension* extension =
extensions::ExtensionRegistry::Get(profile_)->GetInstalledExtension(
app_id);
return (!extension || extension->from_bookmark())
? *web_app_launch_manager_
: *extension_app_launch_manager_;
}
} // namespace apps
// Copyright 2019 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_LAUNCH_SERVICE_LAUNCH_SERVICE_H_
#define CHROME_BROWSER_APPS_LAUNCH_SERVICE_LAUNCH_SERVICE_H_
#include <memory>
#include <string>
#include "base/macros.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/services/app_service/public/mojom/types.mojom.h"
class Profile;
namespace content {
class WebContents;
}
namespace apps {
class LaunchManager;
struct AppLaunchParams;
// This KeyedService receives app launch requests and forwards them
// to the appropriate LaunchManager, based on the type of app.
//
// It is expected to merge into the App Service (Proxy) when that service
// stabilizes. Launch requests will be forwarded through App publishers to App
// providers, and the LaunchManager classes will be retired. See
// chrome/services/app_service/README.md
class LaunchService : public KeyedService {
public:
static LaunchService* Get(Profile* profile);
explicit LaunchService(Profile* profile);
~LaunchService() override;
// Open the application in a way specified by |params|.
content::WebContents* OpenApplication(const AppLaunchParams& params);
private:
LaunchManager& GetLaunchManagerForApp(const std::string& app_id);
Profile* const profile_;
std::unique_ptr<LaunchManager> extension_app_launch_manager_;
std::unique_ptr<LaunchManager> web_app_launch_manager_;
DISALLOW_COPY_AND_ASSIGN(LaunchService);
};
} // namespace apps
#endif // CHROME_BROWSER_APPS_LAUNCH_SERVICE_LAUNCH_SERVICE_H_
// Copyright 2019 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/launch_service/launch_service_factory.h"
#include "chrome/browser/apps/launch_service/launch_service.h"
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
namespace apps {
// static
LaunchService* LaunchServiceFactory::GetForProfile(Profile* profile) {
return static_cast<LaunchService*>(
LaunchServiceFactory::GetInstance()->GetServiceForBrowserContext(
profile, true /* create */));
}
// static
LaunchServiceFactory* LaunchServiceFactory::GetInstance() {
return base::Singleton<LaunchServiceFactory>::get();
}
LaunchServiceFactory::LaunchServiceFactory()
: BrowserContextKeyedServiceFactory(
"LaunchService",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(extensions::ExtensionSystemFactory::GetInstance());
}
LaunchServiceFactory::~LaunchServiceFactory() = default;
KeyedService* LaunchServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
return new LaunchService(Profile::FromBrowserContext(context));
}
bool LaunchServiceFactory::ServiceIsCreatedWithBrowserContext() const {
return true;
}
content::BrowserContext* LaunchServiceFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
Profile* const profile = Profile::FromBrowserContext(context);
if (profile->IsGuestSession()) {
// In guest mode, only off-the-record browsers may be opened.
return profile->GetOffTheRecordProfile();
}
// Do not create secondary instance for incognito WebContents with
// off-the-record profiles for non-guest sessions. Redirect to the instance
// from the original profile part.
return profile->GetOriginalProfile();
}
} // namespace apps
// Copyright 2019 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_LAUNCH_SERVICE_LAUNCH_SERVICE_FACTORY_H_
#define CHROME_BROWSER_APPS_LAUNCH_SERVICE_LAUNCH_SERVICE_FACTORY_H_
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
namespace content {
class BrowserContext;
}
class Profile;
namespace apps {
class LaunchService;
// A factory which associates LaunchService instance with its profile instance.
class LaunchServiceFactory : public BrowserContextKeyedServiceFactory {
public:
static LaunchService* GetForProfile(Profile* profile);
static LaunchServiceFactory* GetInstance();
private:
friend struct base::DefaultSingletonTraits<LaunchServiceFactory>;
LaunchServiceFactory();
~LaunchServiceFactory() override;
// BrowserContextKeyedServiceFactory
KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
bool ServiceIsCreatedWithBrowserContext() const override;
content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
DISALLOW_COPY_AND_ASSIGN(LaunchServiceFactory);
};
} // namespace apps
#endif // CHROME_BROWSER_APPS_LAUNCH_SERVICE_LAUNCH_SERVICE_FACTORY_H_
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/apps/app_service/app_launch_params.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/launch_service/launch_service.h"
#include "chrome/browser/chromeos/crostini/crostini_features.h" #include "chrome/browser/chromeos/crostini/crostini_features.h"
#include "chrome/browser/chromeos/drive/file_system_util.h" #include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/extensions/default_web_app_ids.h" #include "chrome/browser/chromeos/extensions/default_web_app_ids.h"
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.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/launch_service/launch_service.h"
#include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/apps/launch_service/launch_service.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/arc/arc_util.h" #include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/chromeos/arc/session/arc_session_manager.h" #include "chrome/browser/chromeos/arc/session/arc_session_manager.h"
......
...@@ -4,12 +4,15 @@ ...@@ -4,12 +4,15 @@
#include "chrome/browser/ui/web_applications/web_app_launch_manager.h" #include "chrome/browser/ui/web_applications/web_app_launch_manager.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/app_mode/app_mode_utils.h"
#include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/apps/app_service/app_launch_params.h"
#include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/apps/app_service/launch_utils.h"
#include "chrome/browser/banners/app_banner_settings_helper.h" #include "chrome/browser/banners/app_banner_settings_helper.h"
#include "chrome/browser/engagement/site_engagement_service.h" #include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/browser_navigator.h"
...@@ -98,7 +101,7 @@ content::WebContents* NavigateWebApplicationWindow( ...@@ -98,7 +101,7 @@ content::WebContents* NavigateWebApplicationWindow(
} }
WebAppLaunchManager::WebAppLaunchManager(Profile* profile) WebAppLaunchManager::WebAppLaunchManager(Profile* profile)
: apps::LaunchManager(profile), provider_(WebAppProvider::Get(profile)) {} : profile_(profile), provider_(WebAppProvider::Get(profile)) {}
WebAppLaunchManager::~WebAppLaunchManager() = default; WebAppLaunchManager::~WebAppLaunchManager() = default;
...@@ -108,7 +111,7 @@ content::WebContents* WebAppLaunchManager::OpenApplication( ...@@ -108,7 +111,7 @@ content::WebContents* WebAppLaunchManager::OpenApplication(
return nullptr; return nullptr;
if (params.container == apps::mojom::LaunchContainer::kLaunchContainerWindow) if (params.container == apps::mojom::LaunchContainer::kLaunchContainerWindow)
RecordAppWindowLaunch(profile(), params.app_id); RecordAppWindowLaunch(profile_, params.app_id);
web_app::FileHandlerManager& file_handler_manager = web_app::FileHandlerManager& file_handler_manager =
provider_->file_handler_manager(); provider_->file_handler_manager();
...@@ -122,10 +125,10 @@ content::WebContents* WebAppLaunchManager::OpenApplication( ...@@ -122,10 +125,10 @@ content::WebContents* WebAppLaunchManager::OpenApplication(
// System Web Apps go through their own launch path. // System Web Apps go through their own launch path.
base::Optional<SystemAppType> system_app_type = base::Optional<SystemAppType> system_app_type =
GetSystemWebAppTypeForAppId(profile(), params.app_id); GetSystemWebAppTypeForAppId(profile_, params.app_id);
if (system_app_type) { if (system_app_type) {
Browser* browser = Browser* browser =
LaunchSystemWebApp(profile(), *system_app_type, url, params); LaunchSystemWebApp(profile_, *system_app_type, url, params);
return browser->tab_strip_model()->GetActiveWebContents(); return browser->tab_strip_model()->GetActiveWebContents();
} }
...@@ -133,19 +136,19 @@ content::WebContents* WebAppLaunchManager::OpenApplication( ...@@ -133,19 +136,19 @@ content::WebContents* WebAppLaunchManager::OpenApplication(
WindowOpenDisposition disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; WindowOpenDisposition disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
if (params.container == apps::mojom::LaunchContainer::kLaunchContainerTab) { if (params.container == apps::mojom::LaunchContainer::kLaunchContainerTab) {
browser = chrome::FindTabbedBrowser( browser = chrome::FindTabbedBrowser(
profile(), /*match_original_profiles=*/false, params.display_id); profile_, /*match_original_profiles=*/false, params.display_id);
if (browser) { if (browser) {
// For existing browser, ensure its window is activated. // For existing browser, ensure its window is activated.
browser->window()->Activate(); browser->window()->Activate();
disposition = params.disposition; disposition = params.disposition;
} else { } else {
browser = browser =
new Browser(Browser::CreateParams(Browser::TYPE_NORMAL, profile(), new Browser(Browser::CreateParams(Browser::TYPE_NORMAL, profile_,
/*user_gesture=*/true)); /*user_gesture=*/true));
} }
} else { } else {
browser = CreateWebApplicationWindow(profile(), params.app_id, browser =
params.disposition); CreateWebApplicationWindow(profile_, params.app_id, params.disposition);
} }
content::WebContents* web_contents; content::WebContents* web_contents;
...@@ -194,8 +197,8 @@ content::WebContents* WebAppLaunchManager::OpenApplication( ...@@ -194,8 +197,8 @@ content::WebContents* WebAppLaunchManager::OpenApplication(
// Record the launch time in the site engagement service. A recent web // Record the launch time in the site engagement service. A recent web
// app launch will provide an engagement boost to the origin. // app launch will provide an engagement boost to the origin.
SiteEngagementService::Get(profile())->SetLastShortcutLaunchTime(web_contents, SiteEngagementService::Get(profile_)->SetLastShortcutLaunchTime(web_contents,
url); url);
// Refresh the app banner added to homescreen event. The user may have // Refresh the app banner added to homescreen event. The user may have
// cleared their browsing data since installing the app, which removes the // cleared their browsing data since installing the app, which removes the
...@@ -248,7 +251,7 @@ void WebAppLaunchManager::LaunchWebApplication( ...@@ -248,7 +251,7 @@ void WebAppLaunchManager::LaunchWebApplication(
DCHECK(browser); DCHECK(browser);
} else { } else {
// Open an empty browser window as the app_id is invalid. // Open an empty browser window as the app_id is invalid.
browser = apps::CreateBrowserWithNewTabPage(profile()); browser = apps::CreateBrowserWithNewTabPage(profile_);
params.container = apps::mojom::LaunchContainer::kLaunchContainerNone; params.container = apps::mojom::LaunchContainer::kLaunchContainerNone;
} }
std::move(callback).Run(browser, params.container); std::move(callback).Run(browser, params.container);
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "chrome/browser/apps/launch_service/launch_manager.h" #include "components/services/app_service/public/mojom/types.mojom.h"
class Browser; class Browser;
enum class WindowOpenDisposition; enum class WindowOpenDisposition;
class GURL; class GURL;
class Profile;
namespace apps { namespace apps {
struct AppLaunchParams; struct AppLaunchParams;
...@@ -32,14 +33,13 @@ class WebAppProvider; ...@@ -32,14 +33,13 @@ class WebAppProvider;
// Handles launch requests for Desktop PWAs and bookmark apps. // Handles launch requests for Desktop PWAs and bookmark apps.
// Web applications have type AppType::kWeb in the app registry. // Web applications have type AppType::kWeb in the app registry.
class WebAppLaunchManager : public apps::LaunchManager { class WebAppLaunchManager {
public: public:
explicit WebAppLaunchManager(Profile* profile); explicit WebAppLaunchManager(Profile* profile);
~WebAppLaunchManager() override; ~WebAppLaunchManager();
// apps::LaunchManager: // apps::LaunchManager:
content::WebContents* OpenApplication( content::WebContents* OpenApplication(const apps::AppLaunchParams& params);
const apps::AppLaunchParams& params) override;
void LaunchApplication( void LaunchApplication(
const std::string& app_id, const std::string& app_id,
...@@ -56,6 +56,7 @@ class WebAppLaunchManager : public apps::LaunchManager { ...@@ -56,6 +56,7 @@ class WebAppLaunchManager : public apps::LaunchManager {
apps::mojom::LaunchContainer container)> apps::mojom::LaunchContainer container)>
callback); callback);
Profile* const profile_;
WebAppProvider* const provider_; WebAppProvider* const provider_;
base::WeakPtrFactory<WebAppLaunchManager> weak_ptr_factory_{this}; base::WeakPtrFactory<WebAppLaunchManager> weak_ptr_factory_{this};
......
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