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_EXTENSIONS_PLATFORM_APP_LAUNCHER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_LAUNCHER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_LAUNCHER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_LAUNCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 class CommandLine; | 10 class CommandLine; |
11 class Profile; | 11 class Profile; |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class FilePath; | 14 class FilePath; |
15 } | 15 } |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class WebContents; | 18 class WebContents; |
19 class WebIntentsDispatcher; | |
20 } | 19 } |
21 | 20 |
22 namespace extensions { | 21 namespace extensions { |
23 | 22 |
24 class Extension; | 23 class Extension; |
25 | 24 |
26 // Launches the platform app |extension|. Creates appropriate launch data for | 25 // Launches the platform app |extension|. Creates appropriate launch data for |
27 // the |command_line| fields present. |extension| and |profile| must not be | 26 // the |command_line| fields present. |extension| and |profile| must not be |
28 // NULL. A NULL |command_line| means there is no launch data. If non-empty, | 27 // NULL. A NULL |command_line| means there is no launch data. If non-empty, |
29 // |current_directory| is used to expand any relative paths on the command line. | 28 // |current_directory| is used to expand any relative paths on the command line. |
30 void LaunchPlatformApp(Profile* profile, | 29 void LaunchPlatformApp(Profile* profile, |
31 const Extension* extension, | 30 const Extension* extension, |
32 const CommandLine* command_line, | 31 const CommandLine* command_line, |
33 const base::FilePath& current_directory); | 32 const base::FilePath& current_directory); |
34 | 33 |
35 // Launches the platform app |extension| with the contents of |file_path| | 34 // Launches the platform app |extension| with the contents of |file_path| |
36 // available through the launch data. | 35 // available through the launch data. |
37 void LaunchPlatformAppWithPath(Profile* profile, | 36 void LaunchPlatformAppWithPath(Profile* profile, |
38 const Extension* extension, | 37 const Extension* extension, |
39 const base::FilePath& file_path); | 38 const base::FilePath& file_path); |
40 | 39 |
41 // Launches the platform app |extension| with the contents of |file_path| | 40 // Launches the platform app |extension| with the contents of |file_path| |
42 // available through the launch data. | 41 // available through the launch data. |
43 void LaunchPlatformAppWithFileHandler(Profile* profile, | 42 void LaunchPlatformAppWithFileHandler(Profile* profile, |
44 const Extension* extension, | 43 const Extension* extension, |
45 const std::string& handler_id, | 44 const std::string& handler_id, |
46 const base::FilePath& file_path); | 45 const base::FilePath& file_path); |
47 | 46 |
48 #if defined(ENABLE_WEB_INTENTS) | |
49 // Launches the platform app |extension| with the supplied web intent. Creates | |
50 // appropriate launch data for the |web_intent_data| field present. |extension| | |
51 // and |profile| must not be NULL. | |
52 void LaunchPlatformAppWithWebIntent( | |
53 Profile* profile, | |
54 const Extension* extension, | |
55 content::WebIntentsDispatcher* intents_dispatcher, | |
56 content::WebContents* source); | |
57 #endif | |
58 | |
59 } // namespace extensions | 47 } // namespace extensions |
60 | 48 |
61 #endif // CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_LAUNCHER_H_ | 49 #endif // CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_LAUNCHER_H_ |
OLD | NEW |