[M120 Migration][XWalkExtension] Support IME in xwalk exension
[platform/framework/web/chromium-efl.git] / apps / launcher.h
1 // Copyright 2013 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef APPS_LAUNCHER_H_
6 #define APPS_LAUNCHER_H_
7
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 #include "extensions/common/api/app_runtime.h"
13 #include "extensions/common/constants.h"
14
15 class GURL;
16
17 namespace base {
18 class CommandLine;
19 class FilePath;
20 }
21
22 namespace content {
23 class BrowserContext;
24 }
25
26 namespace extensions {
27 class Extension;
28 namespace api {
29 namespace app_runtime {
30 struct ActionData;
31 }
32 }
33 }
34
35 namespace apps {
36
37 // Launches the platform app |app|. Creates appropriate launch data for the
38 // |command_line| fields present. |app| and |context| must not be NULL. An empty
39 // |command_line| means there is no launch data. If non-empty,
40 // |current_directory| is used to expand any relative paths on the command line.
41 // |source| is one of the enumerated values which trace how the app is launched.
42 void LaunchPlatformAppWithCommandLine(content::BrowserContext* context,
43                                       const extensions::Extension* app,
44                                       const base::CommandLine& command_line,
45                                       const base::FilePath& current_directory,
46                                       extensions::AppLaunchSource source);
47
48 // As above but includes |launch_id|, an id that can be passed to
49 // an app when launched in order to support multiple shelf items per app.
50 void LaunchPlatformAppWithCommandLineAndLaunchId(
51     content::BrowserContext* context,
52     const extensions::Extension* app,
53     const std::string& launch_id,
54     const base::CommandLine& command_line,
55     const base::FilePath& current_directory,
56     extensions::AppLaunchSource source);
57
58 // Launches the platform app |app| by issuing an onLaunched event with the
59 // contents of |file_path| available through the launch data.
60 void LaunchPlatformAppWithPath(content::BrowserContext* context,
61                                const extensions::Extension* app,
62                                const base::FilePath& file_path);
63
64 // Launches the platform app |app| by issuing an onLaunched event with the
65 // contents of |file_paths| available through the launch data.
66 void LaunchPlatformAppWithFilePaths(
67     content::BrowserContext* context,
68     const extensions::Extension* app,
69     const std::vector<base::FilePath>& file_paths);
70
71 // Launches the platform app |app| with the specific |action_data|.
72 void LaunchPlatformAppWithAction(
73     content::BrowserContext* context,
74     const extensions::Extension* app,
75     extensions::api::app_runtime::ActionData action_data);
76
77 // Launches the platform app |app|. |source| tells us how the app is launched.
78 void LaunchPlatformApp(content::BrowserContext* context,
79                        const extensions::Extension* app,
80                        extensions::AppLaunchSource source);
81
82 // Launches the platform app |app| with |handler_id| and the contents of
83 // |file_paths| available through the launch data. |handler_id| corresponds to
84 // the id of the file_handlers item in the manifest that resulted in a match
85 // that triggered this launch.
86 void LaunchPlatformAppWithFileHandler(
87     content::BrowserContext* context,
88     const extensions::Extension* app,
89     const std::string& handler_id,
90     const std::vector<base::FilePath>& file_paths);
91
92 // Launches the platform app |app| with |handler_id|, |url| and |referrer_url|
93 // available through the launch data. |handler_id| corresponds to the id of the
94 // file_handlers item in the manifest that resulted in a match that triggered
95 // this launch.
96 void LaunchPlatformAppWithUrl(content::BrowserContext* context,
97                               const extensions::Extension* app,
98                               const std::string& handler_id,
99                               const GURL& url,
100                               const GURL& referrer_url);
101
102 void RestartPlatformApp(content::BrowserContext* context,
103                         const extensions::Extension* app);
104
105 }  // namespace apps
106
107 #endif  // APPS_LAUNCHER_H_