1bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch// Copyright 2013 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch#ifndef APPS_LAUNCHER_H_
6bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch#define APPS_LAUNCHER_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include <string>
92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class CommandLine;
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Profile;
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace base {
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class FilePath;
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace extensions {
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Extension;
19bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch}
20bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch
21bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdochnamespace apps {
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Launches the platform app |extension|. Creates appropriate launch data for
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the |command_line| fields present. |extension| and |profile| must not be
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// NULL. A NULL |command_line| means there is no launch data. If non-empty,
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// |current_directory| is used to expand any relative paths on the command line.
27868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void LaunchPlatformAppWithCommandLine(Profile* profile,
28bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch                                      const extensions::Extension* extension,
29868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                      const CommandLine* command_line,
30868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                      const base::FilePath& current_directory);
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Launches the platform app |extension| with the contents of |file_path|
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// available through the launch data.
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void LaunchPlatformAppWithPath(Profile* profile,
35bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch                               const extensions::Extension* extension,
362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                               const base::FilePath& file_path);
372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
38868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Launches the platform app |extension| with no launch data.
39bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdochvoid LaunchPlatformApp(Profile* profile,
40bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch                       const extensions::Extension* extension);
41868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Launches the platform app |extension| with the contents of |file_path|
432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// available through the launch data.
442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)void LaunchPlatformAppWithFileHandler(Profile* profile,
45bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch                                      const extensions::Extension* extension,
462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                                      const std::string& handler_id,
472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                                      const base::FilePath& file_path);
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
49bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdochvoid RestartPlatformApp(Profile* profile,
50bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch                        const extensions::Extension* extension);
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
52bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch}  // namespace apps
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
54bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch#endif  // APPS_LAUNCHER_H_
55