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/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "chrome/browser/ui/host_desktop.h" | 10 #include "chrome/browser/ui/host_desktop.h" |
11 #include "chrome/common/extensions/extension_constants.h" | 11 #include "chrome/common/extensions/extension_constants.h" |
| 12 #include "extensions/common/constants.h" |
12 #include "ui/base/window_open_disposition.h" | 13 #include "ui/base/window_open_disposition.h" |
13 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
14 #include "url/gurl.h" | 15 #include "url/gurl.h" |
15 | 16 |
16 class Browser; | 17 class Browser; |
17 class Profile; | 18 class Profile; |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class CommandLine; | 21 class CommandLine; |
21 } | 22 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // position and dimensions. | 74 // position and dimensions. |
74 gfx::Rect override_bounds; | 75 gfx::Rect override_bounds; |
75 | 76 |
76 // If non-empty, information from the command line may be passed on to the | 77 // If non-empty, information from the command line may be passed on to the |
77 // application. | 78 // application. |
78 base::CommandLine command_line; | 79 base::CommandLine command_line; |
79 | 80 |
80 // If non-empty, the current directory from which any relative paths on the | 81 // If non-empty, the current directory from which any relative paths on the |
81 // command line should be expanded from. | 82 // command line should be expanded from. |
82 base::FilePath current_directory; | 83 base::FilePath current_directory; |
| 84 |
| 85 // Record where the app is launched from for tracking purpose. |
| 86 // Different app may have their own enumeration of sources. |
| 87 extensions::AppLaunchSource source; |
83 }; | 88 }; |
84 | 89 |
85 // Opens the application, possibly prompting the user to re-enable it. | 90 // Opens the application, possibly prompting the user to re-enable it. |
86 void OpenApplicationWithReenablePrompt(const AppLaunchParams& params); | 91 void OpenApplicationWithReenablePrompt(const AppLaunchParams& params); |
87 | 92 |
88 // Open the application in a way specified by |params|. | 93 // Open the application in a way specified by |params|. |
89 content::WebContents* OpenApplication(const AppLaunchParams& params); | 94 content::WebContents* OpenApplication(const AppLaunchParams& params); |
90 | 95 |
91 // Open |url| in an app shortcut window. | 96 // Open |url| in an app shortcut window. |
92 // There are two kinds of app shortcuts: Shortcuts to a URL, | 97 // There are two kinds of app shortcuts: Shortcuts to a URL, |
93 // and shortcuts that open an installed application. This function | 98 // and shortcuts that open an installed application. This function |
94 // is used to open the former. To open the latter, use | 99 // is used to open the former. To open the latter, use |
95 // application_launch::OpenApplication(). | 100 // application_launch::OpenApplication(). |
96 content::WebContents* OpenAppShortcutWindow(Profile* profile, | 101 content::WebContents* OpenAppShortcutWindow(Profile* profile, |
97 const GURL& url); | 102 const GURL& url); |
98 | 103 |
99 // Whether the extension can be launched by sending a | 104 // Whether the extension can be launched by sending a |
100 // chrome.app.runtime.onLaunched event. | 105 // chrome.app.runtime.onLaunched event. |
101 bool CanLaunchViaEvent(const extensions::Extension* extension); | 106 bool CanLaunchViaEvent(const extensions::Extension* extension); |
102 | 107 |
103 // Get the launch URL for a given extension, with optional override/fallback. | 108 // Get the launch URL for a given extension, with optional override/fallback. |
104 // |override_url|, if non-empty, will be preferred over the extension's | 109 // |override_url|, if non-empty, will be preferred over the extension's |
105 // launch url. | 110 // launch url. |
106 GURL UrlForExtension(const extensions::Extension* extension, | 111 GURL UrlForExtension(const extensions::Extension* extension, |
107 const GURL& override_url); | 112 const GURL& override_url); |
108 | 113 |
109 #endif // CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_ | 114 #endif // CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_ |
OLD | NEW |