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
3 // found in the LICENSE file.
5 #ifndef APPS_LAUNCHER_H_
6 #define APPS_LAUNCHER_H_
18 namespace extensions
{
24 // Launches the platform app |extension|. Creates appropriate launch data for
25 // the |command_line| fields present. |extension| and |profile| must not be
26 // NULL. An empty |command_line| means there is no launch data. If non-empty,
27 // |current_directory| is used to expand any relative paths on the command line.
28 void LaunchPlatformAppWithCommandLine(Profile
* profile
,
29 const extensions::Extension
* extension
,
30 const base::CommandLine
& command_line
,
31 const base::FilePath
& current_directory
);
33 // Launches the platform app |extension| by issuing an onLaunched event
34 // with the contents of |file_path| available through the launch data.
35 void LaunchPlatformAppWithPath(Profile
* profile
,
36 const extensions::Extension
* extension
,
37 const base::FilePath
& file_path
);
39 // Launches the platform app |extension| with no launch data.
40 void LaunchPlatformApp(Profile
* profile
,
41 const extensions::Extension
* extension
);
43 // Launches the platform app |extension| with |handler_id| and the contents of
44 // |file_path| available through the launch data. |handler_id| corresponds to
45 // the id of the file_handlers item in the manifest that resulted in a match
46 // that triggered this launch.
47 void LaunchPlatformAppWithFileHandler(Profile
* profile
,
48 const extensions::Extension
* extension
,
49 const std::string
& handler_id
,
50 const base::FilePath
& file_path
);
52 // Launches the platform app |extension| with |handler_id|, |url| and
53 // |referrer_url| available through the launch data. |handler_id| corresponds to
54 // the id of the file_handlers item in the manifest that resulted in a match
55 // that triggered this launch.
56 void LaunchPlatformAppWithUrl(Profile
* profile
,
57 const extensions::Extension
* extension
,
58 const std::string
& handler_id
,
60 const GURL
& referrer_url
);
62 void RestartPlatformApp(Profile
* profile
,
63 const extensions::Extension
* extension
);
67 #endif // APPS_LAUNCHER_H_