| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "extensions/common/api/app_runtime.h" | |
| 13 #include "extensions/common/constants.h" | 12 #include "extensions/common/constants.h" |
| 14 | 13 |
| 15 class GURL; | 14 class GURL; |
| 16 class Profile; | 15 class Profile; |
| 17 | 16 |
| 18 namespace base { | 17 namespace base { |
| 19 class CommandLine; | 18 class CommandLine; |
| 20 class FilePath; | 19 class FilePath; |
| 21 } | 20 } |
| 22 | 21 |
| 23 namespace extensions { | 22 namespace extensions { |
| 24 class Extension; | 23 class Extension; |
| 25 namespace api { | 24 namespace api { |
| 26 namespace app_runtime { | 25 namespace app_runtime { |
| 27 struct ActionData; | 26 struct ActionData; |
| 28 } | 27 } |
| 29 } | 28 } |
| 30 } | 29 } |
| 31 | 30 |
| 32 namespace apps { | 31 namespace apps { |
| 33 | 32 |
| 34 // Launches the platform app |app|. Creates appropriate launch data for the | 33 // Launches the platform app |app|. Creates appropriate launch data for the |
| 35 // |command_line| fields present. |app| and |profile| must not be NULL. An empty | 34 // |command_line| fields present. |app| and |profile| must not be NULL. An empty |
| 36 // |command_line| means there is no launch data. If non-empty, | 35 // |command_line| means there is no launch data. If non-empty, |
| 37 // |current_directory| is used to expand any relative paths on the command line. | 36 // |current_directory| is used to expand any relative paths on the command line. |
| 38 // |source| is one of the enumerated values which trace how the app is launched. | 37 // |source| is one of the enumerated values which trace how the app is launched. |
| 39 void LaunchPlatformAppWithCommandLine( | 38 void LaunchPlatformAppWithCommandLine(Profile* profile, |
| 40 Profile* profile, | 39 const extensions::Extension* app, |
| 41 const extensions::Extension* app, | 40 const base::CommandLine& command_line, |
| 42 const base::CommandLine& command_line, | 41 const base::FilePath& current_directory, |
| 43 const base::FilePath& current_directory, | 42 extensions::AppLaunchSource source); |
| 44 extensions::AppLaunchSource source, | |
| 45 extensions::api::app_runtime::PlayStoreStatus play_store_status = | |
| 46 extensions::api::app_runtime::PlayStoreStatus:: | |
| 47 PLAY_STORE_STATUS_UNKNOWN); | |
| 48 | 43 |
| 49 // Launches the platform app |app| by issuing an onLaunched event with the | 44 // Launches the platform app |app| by issuing an onLaunched event with the |
| 50 // contents of |file_path| available through the launch data. | 45 // contents of |file_path| available through the launch data. |
| 51 void LaunchPlatformAppWithPath(Profile* profile, | 46 void LaunchPlatformAppWithPath(Profile* profile, |
| 52 const extensions::Extension* app, | 47 const extensions::Extension* app, |
| 53 const base::FilePath& file_path); | 48 const base::FilePath& file_path); |
| 54 | 49 |
| 55 // Launches the platform app |app| with the specific |action_data|. |file_path| | 50 // Launches the platform app |app| with the specific |action_data|. |file_path| |
| 56 // is an optional argument and if present contains the file that the app should | 51 // is an optional argument and if present contains the file that the app should |
| 57 // open w.r.t. the given action. | 52 // open w.r.t. the given action. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 84 const extensions::Extension* app, | 79 const extensions::Extension* app, |
| 85 const std::string& handler_id, | 80 const std::string& handler_id, |
| 86 const GURL& url, | 81 const GURL& url, |
| 87 const GURL& referrer_url); | 82 const GURL& referrer_url); |
| 88 | 83 |
| 89 void RestartPlatformApp(Profile* profile, const extensions::Extension* app); | 84 void RestartPlatformApp(Profile* profile, const extensions::Extension* app); |
| 90 | 85 |
| 91 } // namespace apps | 86 } // namespace apps |
| 92 | 87 |
| 93 #endif // APPS_LAUNCHER_H_ | 88 #endif // APPS_LAUNCHER_H_ |
| OLD | NEW |