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_APPLICATION_LAUNCH_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_ |
| 7 | 7 |
| 8 #include "base/command_line.h" | |
| 8 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 9 #include "chrome/browser/ui/host_desktop.h" | 10 #include "chrome/browser/ui/host_desktop.h" |
| 10 #include "chrome/common/extensions/extension_constants.h" | 11 #include "chrome/common/extensions/extension_constants.h" |
| 11 #include "ui/base/window_open_disposition.h" | 12 #include "ui/base/window_open_disposition.h" |
| 12 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
| 13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 14 | 15 |
| 15 class Browser; | 16 class Browser; |
| 16 class CommandLine; | 17 class CommandLine; |
| 17 class Profile; | 18 class Profile; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 42 // indicates the desktop upon which to launch (Ash or Native). | 43 // indicates the desktop upon which to launch (Ash or Native). |
| 43 AppLaunchParams(Profile* profile, | 44 AppLaunchParams(Profile* profile, |
| 44 const extensions::Extension* extension, | 45 const extensions::Extension* extension, |
| 45 int event_flags, | 46 int event_flags, |
| 46 chrome::HostDesktopType desktop_type); | 47 chrome::HostDesktopType desktop_type); |
| 47 | 48 |
| 48 // The profile to load the application from. | 49 // The profile to load the application from. |
| 49 Profile* profile; | 50 Profile* profile; |
| 50 | 51 |
| 51 // The extension to load. | 52 // The extension to load. |
| 52 const extensions::Extension* extension; | 53 std::string extension_id; |
| 53 | 54 |
| 54 // The container type to launch the application in. | 55 // The container type to launch the application in. |
| 55 extensions::LaunchContainer container; | 56 extensions::LaunchContainer container; |
| 56 | 57 |
| 57 // If container is TAB, this field controls how the tab is opened. | 58 // If container is TAB, this field controls how the tab is opened. |
| 58 WindowOpenDisposition disposition; | 59 WindowOpenDisposition disposition; |
| 59 | 60 |
| 60 // The desktop type to launch on. Uses GetActiveDesktop() if unspecified. | 61 // The desktop type to launch on. Uses GetActiveDesktop() if unspecified. |
| 61 chrome::HostDesktopType desktop_type; | 62 chrome::HostDesktopType desktop_type; |
| 62 | 63 |
| 63 // If non-empty, use override_url in place of the application's launch url. | 64 // If non-empty, use override_url in place of the application's launch url. |
| 64 GURL override_url; | 65 GURL override_url; |
| 65 | 66 |
| 66 // If non-empty, use override_boudns in place of the application's default | 67 // If non-empty, use override_boudns in place of the application's default |
| 67 // position and dimensions. | 68 // position and dimensions. |
| 68 gfx::Rect override_bounds; | 69 gfx::Rect override_bounds; |
| 69 | 70 |
| 70 // If non-NULL, information from the command line may be passed on to the | 71 // If non-NULL, information from the command line may be passed on to the |
|
tapted
2013/12/13 03:10:58
nit: update comment (re: non-NULL)
koz (OOO until 15th September)
2013/12/13 03:54:42
Done.
| |
| 71 // application. | 72 // application. |
| 72 const CommandLine* command_line; | 73 CommandLine command_line; |
| 73 | 74 |
| 74 // If non-empty, the current directory from which any relative paths on the | 75 // If non-empty, the current directory from which any relative paths on the |
| 75 // command line should be expanded from. | 76 // command line should be expanded from. |
| 76 base::FilePath current_directory; | 77 base::FilePath current_directory; |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 // Opens the application, possibly prompting the user to re-enable it. | 80 // Opens the application, possibly prompting the user to re-enable it. |
| 80 void OpenApplicationWithReenablePrompt(const AppLaunchParams& params); | 81 void OpenApplicationWithReenablePrompt(const AppLaunchParams& params); |
| 81 | 82 |
| 82 // Open the application in a way specified by |params|. | 83 // Open the application in a way specified by |params|. |
| 83 content::WebContents* OpenApplication(const AppLaunchParams& params); | 84 content::WebContents* OpenApplication(const AppLaunchParams& params); |
| 84 | 85 |
| 85 // Open |url| in an app shortcut window. |override_bounds| param is optional. | 86 // Open |url| in an app shortcut window. |override_bounds| param is optional. |
| 86 // There are two kinds of app shortcuts: Shortcuts to a URL, | 87 // There are two kinds of app shortcuts: Shortcuts to a URL, |
| 87 // and shortcuts that open an installed application. This function | 88 // and shortcuts that open an installed application. This function |
| 88 // is used to open the former. To open the latter, use | 89 // is used to open the former. To open the latter, use |
| 89 // application_launch::OpenApplication(). | 90 // application_launch::OpenApplication(). |
| 90 content::WebContents* OpenAppShortcutWindow(Profile* profile, | 91 content::WebContents* OpenAppShortcutWindow(Profile* profile, |
| 91 const GURL& url, | 92 const GURL& url, |
| 92 const gfx::Rect& override_bounds); | 93 const gfx::Rect& override_bounds); |
| 93 | 94 |
| 94 #endif // CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_ | 95 #endif // CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_ |
| OLD | NEW |