Chromium Code Reviews| 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/aura/window.h" | |
| 15 #include "ui/base/window_open_disposition.h" | 16 #include "ui/base/window_open_disposition.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 const aura::Window* root_window = NULL); | |
|
stevenjb
2017/05/22 17:55:29
nullptr
| |
| 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 root window from which the app is launched. | |
| 78 const aura::Window* root_window; | |
| 74 }; | 79 }; |
| 75 | 80 |
| 76 // Helper to create AppLaunchParams using extensions::GetLaunchContainer with | 81 // Helper to create AppLaunchParams using extensions::GetLaunchContainer with |
| 77 // LAUNCH_TYPE_REGULAR to check for a user-configured container. | 82 // LAUNCH_TYPE_REGULAR to check for a user-configured container. |
| 78 AppLaunchParams CreateAppLaunchParamsUserContainer( | 83 AppLaunchParams CreateAppLaunchParamsUserContainer( |
| 79 Profile* profile, | 84 Profile* profile, |
| 80 const extensions::Extension* extension, | 85 const extensions::Extension* extension, |
| 81 WindowOpenDisposition disposition, | 86 WindowOpenDisposition disposition, |
| 82 extensions::AppLaunchSource source); | 87 extensions::AppLaunchSource source); |
| 83 | 88 |
| 84 // Helper to create AppLaunchParams using event flags that allows user to | 89 // Helper to create AppLaunchParams using event flags that allows user to |
| 85 // override the user-configured container using modifier keys, falling back to | 90 // override the user-configured container using modifier keys, falling back to |
| 86 // extensions::GetLaunchContainer() with no modifiers. | 91 // extensions::GetLaunchContainer() with no modifiers. |root_window| is the root |
| 92 // window from which the app is launched. | |
| 87 AppLaunchParams CreateAppLaunchParamsWithEventFlags( | 93 AppLaunchParams CreateAppLaunchParamsWithEventFlags( |
| 88 Profile* profile, | 94 Profile* profile, |
| 89 const extensions::Extension* extension, | 95 const extensions::Extension* extension, |
| 90 int event_flags, | 96 int event_flags, |
| 91 extensions::AppLaunchSource source); | 97 extensions::AppLaunchSource source, |
| 98 const aura::Window* root_window); | |
| 92 | 99 |
| 93 #endif // CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_ | 100 #endif // CHROME_BROWSER_UI_EXTENSIONS_APP_LAUNCH_PARAMS_H_ |
| OLD | NEW |