OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "chrome/common/extensions/extension_constants.h" |
| 10 #include "webkit/glue/window_open_disposition.h" |
| 11 |
| 12 class Browser; |
| 13 class GURL; |
| 14 class Profile; |
| 15 |
| 16 namespace content { |
| 17 class WebContents; |
| 18 } |
| 19 |
| 20 namespace extensions { |
| 21 class Extension; |
| 22 } |
| 23 |
| 24 namespace application_launch { |
| 25 |
| 26 // Open |extension| in |container|, using |disposition| if container type is |
| 27 // TAB. Returns the WebContents* that was created or NULL. If non-empty, |
| 28 // |override_url| is used in place of the app launch url. |
| 29 content::WebContents* OpenApplication(Profile* profile, |
| 30 const extensions::Extension* extension, |
| 31 extension_misc::LaunchContainer container, |
| 32 const GURL& override_url, |
| 33 WindowOpenDisposition disposition); |
| 34 |
| 35 #if defined(USE_ASH) |
| 36 // Opens |url| in a new application panel window for the specified url. |
| 37 content::WebContents* OpenApplicationPanel( |
| 38 Profile* profile, |
| 39 const extensions::Extension* extension, |
| 40 const GURL& url); |
| 41 #endif |
| 42 |
| 43 // Opens a new application window for the specified url. If |as_panel| is true, |
| 44 // the application will be opened as a Browser::Type::APP_PANEL in app panel |
| 45 // window, otherwise it will be opened as as either Browser::Type::APP a.k.a. |
| 46 // "thin frame" (if |extension| is NULL) or Browser::Type::EXTENSION_APP (if |
| 47 // |extension| is non-NULL)./ If |app_browser| is not NULL, it is set to the |
| 48 // browser that hosts the returned tab. |
| 49 content::WebContents* OpenApplicationWindow( |
| 50 Profile* profile, |
| 51 const extensions::Extension* extension, |
| 52 extension_misc::LaunchContainer container, |
| 53 const GURL& url, |
| 54 Browser** app_browser); |
| 55 |
| 56 // Open |url| in an app shortcut window. If |update_shortcut| is true, |
| 57 // update the name, description, and favicon of the shortcut. |
| 58 // There are two kinds of app shortcuts: Shortcuts to a URL, |
| 59 // and shortcuts that open an installed application. This function |
| 60 // is used to open the former. To open the latter, use |
| 61 // Browser::OpenApplicationWindow(). |
| 62 content::WebContents* OpenAppShortcutWindow(Profile* profile, |
| 63 const GURL& url, |
| 64 bool update_shortcut); |
| 65 |
| 66 // Open an application for |extension| using |disposition|. Returns NULL if |
| 67 // there are no appropriate existing browser windows for |profile|. If |
| 68 // non-empty, |override_url| is used in place of the app launch url. |
| 69 content::WebContents* OpenApplicationTab(Profile* profile, |
| 70 const extensions::Extension* extension, |
| 71 const GURL& override_url, |
| 72 WindowOpenDisposition disposition); |
| 73 |
| 74 } // namespace application_launch |
| 75 |
| 76 #endif // CHROME_BROWSER_UI_EXTENSIONS_APPLICATION_LAUNCH_H_ |
OLD | NEW |