Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 APPS_LAUNCHER_H_ | 5 #ifndef APPS_LAUNCHER_H_ |
| 6 #define APPS_LAUNCHER_H_ | 6 #define APPS_LAUNCHER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "extensions/common/constants.h" | |
| 12 | |
| 11 class GURL; | 13 class GURL; |
| 12 class Profile; | 14 class Profile; |
| 13 | 15 |
| 14 namespace base { | 16 namespace base { |
| 15 class CommandLine; | 17 class CommandLine; |
| 16 class FilePath; | 18 class FilePath; |
| 17 } | 19 } |
| 18 | 20 |
| 19 namespace extensions { | 21 namespace extensions { |
| 20 class Extension; | 22 class Extension; |
| 21 } | 23 } |
| 22 | 24 |
| 23 namespace apps { | 25 namespace apps { |
| 24 | 26 |
| 25 // Launches the platform app |extension|. Creates appropriate launch data for | 27 // Launches the platform app |extension|. Creates appropriate launch data for |
| 26 // the |command_line| fields present. |extension| and |profile| must not be | 28 // the |command_line| fields present. |extension| and |profile| must not be |
| 27 // NULL. An empty |command_line| means there is no launch data. If non-empty, | 29 // NULL. An empty |command_line| means there is no launch data. If non-empty, |
| 28 // |current_directory| is used to expand any relative paths on the command line. | 30 // |current_directory| is used to expand any relative paths on the command line. |
|
benwells
2014/10/21 03:51:58
Please add a comment for the new parameter (here a
cylee1
2014/10/21 13:41:16
Done.
| |
| 29 void LaunchPlatformAppWithCommandLine(Profile* profile, | 31 void LaunchPlatformAppWithCommandLine(Profile* profile, |
| 30 const extensions::Extension* extension, | 32 const extensions::Extension* extension, |
| 31 const base::CommandLine& command_line, | 33 const base::CommandLine& command_line, |
| 32 const base::FilePath& current_directory); | 34 const base::FilePath& current_directory, |
| 35 extensions::AppLaunchSource source); | |
| 33 | 36 |
| 34 // Launches the platform app |extension| by issuing an onLaunched event | 37 // Launches the platform app |extension| by issuing an onLaunched event |
| 35 // with the contents of |file_path| available through the launch data. | 38 // with the contents of |file_path| available through the launch data. |
| 36 void LaunchPlatformAppWithPath(Profile* profile, | 39 void LaunchPlatformAppWithPath(Profile* profile, |
| 37 const extensions::Extension* extension, | 40 const extensions::Extension* extension, |
| 38 const base::FilePath& file_path); | 41 const base::FilePath& file_path); |
| 39 | 42 |
| 40 // Launches the platform app |extension| with no launch data. | 43 // Launches the platform app |extension| with no launch data. |
| 41 void LaunchPlatformApp(Profile* profile, | 44 void LaunchPlatformApp(Profile* profile, |
|
benwells
2014/10/21 03:51:58
Can't you just add the source parameter to this fu
cylee1
2014/10/21 13:41:16
Done.
| |
| 42 const extensions::Extension* extension); | 45 const extensions::Extension* extension); |
| 43 | 46 |
| 47 // Launches the platform app |extension| with no launch data. | |
| 48 void LaunchPlatformAppWithSource(Profile* profile, | |
| 49 const extensions::Extension* extension, | |
| 50 extensions::AppLaunchSource source); | |
| 51 | |
| 44 // Launches the platform app |extension| with |handler_id| and the contents of | 52 // Launches the platform app |extension| with |handler_id| and the contents of |
| 45 // |file_paths| available through the launch data. |handler_id| corresponds to | 53 // |file_paths| available through the launch data. |handler_id| corresponds to |
| 46 // the id of the file_handlers item in the manifest that resulted in a match | 54 // the id of the file_handlers item in the manifest that resulted in a match |
| 47 // that triggered this launch. | 55 // that triggered this launch. |
| 48 void LaunchPlatformAppWithFileHandler( | 56 void LaunchPlatformAppWithFileHandler( |
| 49 Profile* profile, | 57 Profile* profile, |
| 50 const extensions::Extension* extension, | 58 const extensions::Extension* extension, |
| 51 const std::string& handler_id, | 59 const std::string& handler_id, |
| 52 const std::vector<base::FilePath>& file_paths); | 60 const std::vector<base::FilePath>& file_paths); |
| 53 | 61 |
| 54 // Launches the platform app |extension| with |handler_id|, |url| and | 62 // Launches the platform app |extension| with |handler_id|, |url| and |
| 55 // |referrer_url| available through the launch data. |handler_id| corresponds to | 63 // |referrer_url| available through the launch data. |handler_id| corresponds to |
| 56 // the id of the file_handlers item in the manifest that resulted in a match | 64 // the id of the file_handlers item in the manifest that resulted in a match |
| 57 // that triggered this launch. | 65 // that triggered this launch. |
| 58 void LaunchPlatformAppWithUrl(Profile* profile, | 66 void LaunchPlatformAppWithUrl(Profile* profile, |
| 59 const extensions::Extension* extension, | 67 const extensions::Extension* extension, |
| 60 const std::string& handler_id, | 68 const std::string& handler_id, |
| 61 const GURL& url, | 69 const GURL& url, |
| 62 const GURL& referrer_url); | 70 const GURL& referrer_url); |
| 63 | 71 |
| 64 void RestartPlatformApp(Profile* profile, | 72 void RestartPlatformApp(Profile* profile, |
| 65 const extensions::Extension* extension); | 73 const extensions::Extension* extension); |
| 66 | 74 |
| 67 } // namespace apps | 75 } // namespace apps |
| 68 | 76 |
| 69 #endif // APPS_LAUNCHER_H_ | 77 #endif // APPS_LAUNCHER_H_ |
| OLD | NEW |