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

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: cros 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..271d87a34c9f764ebb2fd71e6f2ba26a41f74d60 100644
--- a/chrome/browser/ui/extensions/app_launch_params.cc
+++ b/chrome/browser/ui/extensions/app_launch_params.cc
@@ -22,45 +22,35 @@ 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::AppLaunchParams(const AppLaunchParams& other) = default;
+
+AppLaunchParams::~AppLaunchParams() {}
+
+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 +65,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);
}
« no previous file with comments | « chrome/browser/ui/extensions/app_launch_params.h ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698