OLD | NEW |
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 Loading... |
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 // display::kInvalidDisplayId means that the display does not exist or is not |
| 79 // set. |
| 80 int64_t display_id; |
74 }; | 81 }; |
75 | 82 |
76 // Helper to create AppLaunchParams using extensions::GetLaunchContainer with | 83 // Helper to create AppLaunchParams using extensions::GetLaunchContainer with |
77 // LAUNCH_TYPE_REGULAR to check for a user-configured container. | 84 // LAUNCH_TYPE_REGULAR to check for a user-configured container. |
78 AppLaunchParams CreateAppLaunchParamsUserContainer( | 85 AppLaunchParams CreateAppLaunchParamsUserContainer( |
79 Profile* profile, | 86 Profile* profile, |
80 const extensions::Extension* extension, | 87 const extensions::Extension* extension, |
81 WindowOpenDisposition disposition, | 88 WindowOpenDisposition disposition, |
82 extensions::AppLaunchSource source); | 89 extensions::AppLaunchSource source); |
83 | 90 |
84 // Helper to create AppLaunchParams using event flags that allows user to | 91 // Helper to create AppLaunchParams using event flags that allows user to |
85 // override the user-configured container using modifier keys, falling back to | 92 // override the user-configured container using modifier keys, falling back to |
86 // extensions::GetLaunchContainer() with no modifiers. | 93 // extensions::GetLaunchContainer() with no modifiers. |display_id| is the id of |
| 94 // the display from which the app is launched. |
87 AppLaunchParams CreateAppLaunchParamsWithEventFlags( | 95 AppLaunchParams CreateAppLaunchParamsWithEventFlags( |
88 Profile* profile, | 96 Profile* profile, |
89 const extensions::Extension* extension, | 97 const extensions::Extension* extension, |
90 int event_flags, | 98 int event_flags, |
91 extensions::AppLaunchSource source); | 99 extensions::AppLaunchSource source, |
| 100 int64_t display_id); |
92 | 101 |
93 #endif // CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_ | 102 #endif // CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_ |
OLD | NEW |