Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1126)

Unified Diff: chrome/browser/ui/extensions/app_launch_params.cc

Issue 1807743003: Remove HostDesktopType from AppLaunchParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp-parent
Patch Set: fixes Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/extensions/app_launch_params.cc
diff --git a/chrome/browser/ui/extensions/app_launch_params.cc b/chrome/browser/ui/extensions/app_launch_params.cc
index 0abc0a40ec0a0d2423be5f892f7d4e561c40c49b..d1cde5504c8576b3d329134434b249c22417d3ea 100644
--- a/chrome/browser/ui/extensions/app_launch_params.cc
+++ b/chrome/browser/ui/extensions/app_launch_params.cc
@@ -22,45 +22,31 @@ AppLaunchParams::AppLaunchParams(Profile* profile,
extension_id(extension ? extension->id() : std::string()),
container(container),
disposition(disposition),
- desktop_type(chrome::GetActiveDesktop()),
- override_url(),
- override_bounds(),
command_line(base::CommandLine::NO_PROGRAM),
- source(source) {
-}
+ source(source) {}
-AppLaunchParams::AppLaunchParams(Profile* profile,
- const extensions::Extension* extension,
- WindowOpenDisposition disposition,
- extensions::AppLaunchSource source)
- : profile(profile),
- extension_id(extension ? extension->id() : std::string()),
- container(extensions::LAUNCH_CONTAINER_NONE),
- disposition(disposition),
- desktop_type(chrome::GetActiveDesktop()),
- override_url(),
- override_bounds(),
- command_line(base::CommandLine::NO_PROGRAM),
- source(source) {
+AppLaunchParams CreateAppLaunchParamsUserContainer(
+ Profile* profile,
+ const extensions::Extension* extension,
+ WindowOpenDisposition disposition,
+ extensions::AppLaunchSource source) {
// Look up the app preference to find out the right launch container. Default
// is to launch as a regular tab.
- container =
+ extensions::LaunchContainer container =
extensions::GetLaunchContainer(ExtensionPrefs::Get(profile), extension);
+ return AppLaunchParams(profile, extension, container, disposition, source);
}
-AppLaunchParams::AppLaunchParams(Profile* profile,
- const extensions::Extension* extension,
- WindowOpenDisposition raw_disposition,
- chrome::HostDesktopType desktop_type,
- extensions::AppLaunchSource source)
- : profile(profile),
- extension_id(extension ? extension->id() : std::string()),
- container(extensions::LAUNCH_CONTAINER_NONE),
- desktop_type(desktop_type),
- override_url(),
- override_bounds(),
- command_line(base::CommandLine::NO_PROGRAM),
- source(source) {
+AppLaunchParams CreateAppLaunchParamsWithEventFlags(
+ Profile* profile,
+ const extensions::Extension* extension,
+ int event_flags,
+ extensions::AppLaunchSource source) {
+ WindowOpenDisposition raw_disposition =
+ ui::DispositionFromEventFlags(event_flags);
+
+ extensions::LaunchContainer container;
+ WindowOpenDisposition disposition;
if (raw_disposition == NEW_FOREGROUND_TAB ||
raw_disposition == NEW_BACKGROUND_TAB) {
container = extensions::LAUNCH_CONTAINER_TAB;
@@ -75,9 +61,5 @@ AppLaunchParams::AppLaunchParams(Profile* profile,
extensions::GetLaunchContainer(ExtensionPrefs::Get(profile), extension);
disposition = NEW_FOREGROUND_TAB;
}
-}
-
-AppLaunchParams::AppLaunchParams(const AppLaunchParams& other) = default;
-
-AppLaunchParams::~AppLaunchParams() {
+ return AppLaunchParams(profile, extension, container, disposition, source);
}

Powered by Google App Engine
This is Rietveld 408576698