| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_APPS_APP_INFO_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_UI_APPS_APP_INFO_DIALOG_H_ |
| 6 #define CHROME_BROWSER_UI_APPS_APP_INFO_DIALOG_H_ | 6 #define CHROME_BROWSER_UI_APPS_APP_INFO_DIALOG_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 | 10 |
| 11 class Profile; | 11 class Profile; |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class WebContents; | 14 class WebContents; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace extensions { | 17 namespace extensions { |
| 18 class Extension; | 18 class Extension; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace gfx { | 21 namespace gfx { |
| 22 class Rect; | 22 class Rect; |
| 23 class Size; | 23 class Size; |
| 24 } | 24 } |
| 25 | 25 |
| 26 // Used for UMA to track where the App Info dialog is launched from. | 26 // Used for UMA to track where the App Info dialog is launched from. |
| 27 enum AppInfoLaunchSource { | 27 enum AppInfoLaunchSource { |
| 28 #if defined(ENABLE_APP_LIST) |
| 28 FROM_APP_LIST, // Launched from the app list context menu. | 29 FROM_APP_LIST, // Launched from the app list context menu. |
| 30 #endif |
| 29 FROM_EXTENSIONS_PAGE, // Launched from the chrome://extensions page. | 31 FROM_EXTENSIONS_PAGE, // Launched from the chrome://extensions page. |
| 30 FROM_APPS_PAGE, // Launched from chrome://apps context menu. | 32 FROM_APPS_PAGE, // Launched from chrome://apps context menu. |
| 31 NUM_LAUNCH_SOURCES, | 33 NUM_LAUNCH_SOURCES, |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 // TODO(tsergeant): Move these methods into a class | 36 // TODO(tsergeant): Move these methods into a class |
| 35 // Returns true if the app info dialog is available on the current platform. | 37 // Returns true if the app info dialog is available on the current platform. |
| 36 bool CanShowAppInfoDialog(); | 38 bool CanShowAppInfoDialog(); |
| 37 | 39 |
| 38 // Returns the size of the native window container for the app info dialog. | 40 // Returns the size of the native window container for the app info dialog. |
| 39 gfx::Size GetAppInfoNativeDialogSize(); | 41 gfx::Size GetAppInfoNativeDialogSize(); |
| 40 | 42 |
| 43 #if defined(ENABLE_APP_LIST) |
| 41 // Shows the chrome app information as a frameless window for the given |app| | 44 // Shows the chrome app information as a frameless window for the given |app| |
| 42 // and |profile| at the given |app_list_bounds|. Appears 'inside' the app list. | 45 // and |profile| at the given |app_list_bounds|. Appears 'inside' the app list. |
| 43 void ShowAppInfoInAppList(gfx::NativeWindow parent, | 46 void ShowAppInfoInAppList(gfx::NativeWindow parent, |
| 44 const gfx::Rect& app_list_bounds, | 47 const gfx::Rect& app_list_bounds, |
| 45 Profile* profile, | 48 Profile* profile, |
| 46 const extensions::Extension* app, | 49 const extensions::Extension* app, |
| 47 const base::Closure& close_callback); | 50 const base::Closure& close_callback); |
| 51 #endif |
| 48 | 52 |
| 49 // Shows the chrome app information in a native dialog box of the given |size|. | 53 // Shows the chrome app information in a native dialog box of the given |size|. |
| 50 void ShowAppInfoInNativeDialog(content::WebContents* web_contents, | 54 void ShowAppInfoInNativeDialog(content::WebContents* web_contents, |
| 51 const gfx::Size& size, | 55 const gfx::Size& size, |
| 52 Profile* profile, | 56 Profile* profile, |
| 53 const extensions::Extension* app, | 57 const extensions::Extension* app, |
| 54 const base::Closure& close_callback); | 58 const base::Closure& close_callback); |
| 55 | 59 |
| 56 #endif // CHROME_BROWSER_UI_APPS_APP_INFO_DIALOG_H_ | 60 #endif // CHROME_BROWSER_UI_APPS_APP_INFO_DIALOG_H_ |
| OLD | NEW |