blob: 9412c11de7b7db9c16e707039dd71de0d154e621 [file] [log] [blame]
Ben Murdochbb1529c2013-08-08 10:24:53 +01001// Copyright 2013 The Chromium Authors. All rights reserved.
Torne (Richard Coles)58218062012-11-14 11:43:16 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Murdochbb1529c2013-08-08 10:24:53 +01005#ifndef APPS_LAUNCHER_H_
6#define APPS_LAUNCHER_H_
Torne (Richard Coles)58218062012-11-14 11:43:16 +00007
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00008#include <string>
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00009
Torne (Richard Coles)58218062012-11-14 11:43:16 +000010class CommandLine;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000011class Profile;
12
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000013namespace base {
14class FilePath;
15}
16
Ben Murdochbb1529c2013-08-08 10:24:53 +010017namespace extensions {
18class Extension;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000019}
20
Ben Murdochbb1529c2013-08-08 10:24:53 +010021namespace apps {
Torne (Richard Coles)58218062012-11-14 11:43:16 +000022
23// Launches the platform app |extension|. Creates appropriate launch data for
24// the |command_line| fields present. |extension| and |profile| must not be
25// NULL. A NULL |command_line| means there is no launch data. If non-empty,
26// |current_directory| is used to expand any relative paths on the command line.
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +010027void LaunchPlatformAppWithCommandLine(Profile* profile,
Ben Murdochbb1529c2013-08-08 10:24:53 +010028 const extensions::Extension* extension,
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +010029 const CommandLine* command_line,
30 const base::FilePath& current_directory);
Torne (Richard Coles)58218062012-11-14 11:43:16 +000031
32// Launches the platform app |extension| with the contents of |file_path|
33// available through the launch data.
34void LaunchPlatformAppWithPath(Profile* profile,
Ben Murdochbb1529c2013-08-08 10:24:53 +010035 const extensions::Extension* extension,
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000036 const base::FilePath& file_path);
Torne (Richard Coles)58218062012-11-14 11:43:16 +000037
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +010038// Launches the platform app |extension| with no launch data.
Ben Murdochbb1529c2013-08-08 10:24:53 +010039void LaunchPlatformApp(Profile* profile,
40 const extensions::Extension* extension);
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +010041
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000042// Launches the platform app |extension| with the contents of |file_path|
43// available through the launch data.
44void LaunchPlatformAppWithFileHandler(Profile* profile,
Ben Murdochbb1529c2013-08-08 10:24:53 +010045 const extensions::Extension* extension,
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000046 const std::string& handler_id,
47 const base::FilePath& file_path);
48
Ben Murdochbb1529c2013-08-08 10:24:53 +010049void RestartPlatformApp(Profile* profile,
50 const extensions::Extension* extension);
Torne (Richard Coles)58218062012-11-14 11:43:16 +000051
Ben Murdochbb1529c2013-08-08 10:24:53 +010052} // namespace apps
Torne (Richard Coles)58218062012-11-14 11:43:16 +000053
Ben Murdochbb1529c2013-08-08 10:24:53 +010054#endif // APPS_LAUNCHER_H_