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

Side by Side Diff: chrome/browser/ui/extensions/app_launch_params.h

Issue 2894743002: Make launching apps from shelf more intuitive (Closed)
Patch Set: Replace root window with display id in app launch params. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_ 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_
6 #define CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_ 6 #define CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "chrome/common/extensions/extension_constants.h" 12 #include "chrome/common/extensions/extension_constants.h"
13 #include "extensions/common/api/app_runtime.h" 13 #include "extensions/common/api/app_runtime.h"
14 #include "extensions/common/constants.h" 14 #include "extensions/common/constants.h"
15 #include "ui/base/window_open_disposition.h" 15 #include "ui/base/window_open_disposition.h"
16 #include "ui/display/types/display_constants.h"
16 #include "ui/gfx/geometry/rect.h" 17 #include "ui/gfx/geometry/rect.h"
17 #include "url/gurl.h" 18 #include "url/gurl.h"
18 19
19 class Profile; 20 class Profile;
20 21
21 namespace extensions { 22 namespace extensions {
22 class Extension; 23 class Extension;
23 } 24 }
24 25
25 struct AppLaunchParams { 26 struct AppLaunchParams {
26 AppLaunchParams(Profile* profile, 27 AppLaunchParams(Profile* profile,
27 const extensions::Extension* extension, 28 const extensions::Extension* extension,
28 extensions::LaunchContainer container, 29 extensions::LaunchContainer container,
29 WindowOpenDisposition disposition, 30 WindowOpenDisposition disposition,
30 extensions::AppLaunchSource source, 31 extensions::AppLaunchSource source,
31 bool set_playstore_status = false); 32 bool set_playstore_status = false,
33 int64_t display_id = display::kInvalidDisplayId);
32 34
33 AppLaunchParams(const AppLaunchParams& other); 35 AppLaunchParams(const AppLaunchParams& other);
34 36
35 ~AppLaunchParams(); 37 ~AppLaunchParams();
36 38
37 // The profile to load the application from. 39 // The profile to load the application from.
38 Profile* profile; 40 Profile* profile;
39 41
40 // The extension to load. 42 // The extension to load.
41 std::string extension_id; 43 std::string extension_id;
(...skipping 22 matching lines...) Expand all
64 // If non-empty, the current directory from which any relative paths on the 66 // If non-empty, the current directory from which any relative paths on the
65 // command line should be expanded from. 67 // command line should be expanded from.
66 base::FilePath current_directory; 68 base::FilePath current_directory;
67 69
68 // Record where the app is launched from for tracking purpose. 70 // Record where the app is launched from for tracking purpose.
69 // Different app may have their own enumeration of sources. 71 // Different app may have their own enumeration of sources.
70 extensions::AppLaunchSource source; 72 extensions::AppLaunchSource source;
71 73
72 // Status of ARC on this device. 74 // Status of ARC on this device.
73 extensions::api::app_runtime::PlayStoreStatus play_store_status; 75 extensions::api::app_runtime::PlayStoreStatus play_store_status;
76
77 // The id of the display from which the app is launched.
78 // -1 means the display does not exist or is not set.
benwells 2017/05/24 04:05:34 Nit: Use the constant display::kInvalidDisplayId h
weidongg 2017/05/24 17:49:40 Done.
79 int64_t display_id;
74 }; 80 };
75 81
76 // Helper to create AppLaunchParams using extensions::GetLaunchContainer with 82 // Helper to create AppLaunchParams using extensions::GetLaunchContainer with
77 // LAUNCH_TYPE_REGULAR to check for a user-configured container. 83 // LAUNCH_TYPE_REGULAR to check for a user-configured container.
78 AppLaunchParams CreateAppLaunchParamsUserContainer( 84 AppLaunchParams CreateAppLaunchParamsUserContainer(
79 Profile* profile, 85 Profile* profile,
80 const extensions::Extension* extension, 86 const extensions::Extension* extension,
81 WindowOpenDisposition disposition, 87 WindowOpenDisposition disposition,
82 extensions::AppLaunchSource source); 88 extensions::AppLaunchSource source);
83 89
84 // Helper to create AppLaunchParams using event flags that allows user to 90 // Helper to create AppLaunchParams using event flags that allows user to
85 // override the user-configured container using modifier keys, falling back to 91 // override the user-configured container using modifier keys, falling back to
86 // extensions::GetLaunchContainer() with no modifiers. 92 // extensions::GetLaunchContainer() with no modifiers. |display_id| is the id of
93 // the display from which the app is launched.
87 AppLaunchParams CreateAppLaunchParamsWithEventFlags( 94 AppLaunchParams CreateAppLaunchParamsWithEventFlags(
88 Profile* profile, 95 Profile* profile,
89 const extensions::Extension* extension, 96 const extensions::Extension* extension,
90 int event_flags, 97 int event_flags,
91 extensions::AppLaunchSource source); 98 extensions::AppLaunchSource source,
99 int64_t display_id);
92 100
93 #endif // CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_ 101 #endif // CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698