Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / extensions / application_launch.h
blob280d549b87e0a9e8f03095a499838ac024dfa2c8
1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_
6 #define CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_
8 #include "base/command_line.h"
9 #include "base/files/file_path.h"
10 #include "chrome/browser/ui/host_desktop.h"
11 #include "chrome/common/extensions/extension_constants.h"
12 #include "ui/base/window_open_disposition.h"
13 #include "ui/gfx/rect.h"
14 #include "url/gurl.h"
16 class Browser;
17 class CommandLine;
18 class Profile;
20 namespace content {
21 class WebContents;
24 namespace extensions {
25 class Extension;
28 struct AppLaunchParams {
29 AppLaunchParams(Profile* profile,
30 const extensions::Extension* extension,
31 extensions::LaunchContainer container,
32 WindowOpenDisposition disposition);
34 // Helper to create AppLaunchParams using extensions::GetLaunchContainer with
35 // LAUNCH_TYPE_REGULAR to check for a user-configured container.
36 AppLaunchParams(Profile* profile,
37 const extensions::Extension* extension,
38 WindowOpenDisposition disposition);
40 // Helper to create AppLaunchParams using event flags that allows user to
41 // override the user-configured container using modifier keys, falling back to
42 // extensions::GetLaunchContainer() with no modifiers. |desktop_type|
43 // indicates the desktop upon which to launch (Ash or Native).
44 AppLaunchParams(Profile* profile,
45 const extensions::Extension* extension,
46 int event_flags,
47 chrome::HostDesktopType desktop_type);
49 ~AppLaunchParams();
51 // The profile to load the application from.
52 Profile* profile;
54 // The extension to load.
55 std::string extension_id;
57 // The container type to launch the application in.
58 extensions::LaunchContainer container;
60 // If container is TAB, this field controls how the tab is opened.
61 WindowOpenDisposition disposition;
63 // The desktop type to launch on. Uses GetActiveDesktop() if unspecified.
64 chrome::HostDesktopType desktop_type;
66 // If non-empty, use override_url in place of the application's launch url.
67 GURL override_url;
69 // If non-empty, use override_boudns in place of the application's default
70 // position and dimensions.
71 gfx::Rect override_bounds;
73 // If non-empty, information from the command line may be passed on to the
74 // application.
75 CommandLine command_line;
77 // If non-empty, the current directory from which any relative paths on the
78 // command line should be expanded from.
79 base::FilePath current_directory;
82 // Opens the application, possibly prompting the user to re-enable it.
83 void OpenApplicationWithReenablePrompt(const AppLaunchParams& params);
85 // Open the application in a way specified by |params|.
86 content::WebContents* OpenApplication(const AppLaunchParams& params);
88 // Open |url| in an app shortcut window. |override_bounds| param is optional.
89 // There are two kinds of app shortcuts: Shortcuts to a URL,
90 // and shortcuts that open an installed application. This function
91 // is used to open the former. To open the latter, use
92 // application_launch::OpenApplication().
93 content::WebContents* OpenAppShortcutWindow(Profile* profile,
94 const GURL& url,
95 const gfx::Rect& override_bounds);
97 #endif // CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_