[email protected] | c82da8c4 | 2012-06-08 19:49:11 | [diff] [blame] | 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_EXTENSIONS_EXTENSION_INSTALL_UI_DEFAULT_H_ |
| 6 | #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_DEFAULT_H_ |
[email protected] | c82da8c4 | 2012-06-08 19:49:11 | [diff] [blame] | 7 | |
| 8 | #include "chrome/browser/extensions/extension_install_ui.h" |
| 9 | |
| 10 | class InfoBarDelegate; |
[email protected] | 32fc4ff7 | 2012-06-15 21:50:01 | [diff] [blame] | 11 | class Profile; |
[email protected] | 591a59f | 2012-10-11 01:16:23 | [diff] [blame] | 12 | |
| 13 | namespace content { |
| 14 | class WebContents; |
| 15 | } |
[email protected] | c82da8c4 | 2012-06-08 19:49:11 | [diff] [blame] | 16 | |
| 17 | class ExtensionInstallUIDefault : public ExtensionInstallUI { |
| 18 | public: |
[email protected] | 619f8618 | 2012-07-03 21:30:18 | [diff] [blame] | 19 | explicit ExtensionInstallUIDefault(Profile* profile); |
[email protected] | c82da8c4 | 2012-06-08 19:49:11 | [diff] [blame] | 20 | virtual ~ExtensionInstallUIDefault(); |
| 21 | |
| 22 | // ExtensionInstallUI implementation: |
| 23 | virtual void OnInstallSuccess(const extensions::Extension* extension, |
| 24 | SkBitmap* icon) OVERRIDE; |
[email protected] | bf3d9df | 2012-07-24 23:20:27 | [diff] [blame] | 25 | virtual void OnInstallFailure( |
| 26 | const extensions::CrxInstallerError& error) OVERRIDE; |
[email protected] | c82da8c4 | 2012-06-08 19:49:11 | [diff] [blame] | 27 | virtual void SetSkipPostInstallUI(bool skip_ui) OVERRIDE; |
| 28 | virtual void SetUseAppInstalledBubble(bool use_bubble) OVERRIDE; |
| 29 | |
| 30 | private: |
| 31 | // Shows an infobar for a newly-installed theme. previous_theme_id should be |
| 32 | // empty if the previous theme was the system/default theme. |
| 33 | static void ShowThemeInfoBar(const std::string& previous_theme_id, |
| 34 | bool previous_using_native_theme, |
| 35 | const extensions::Extension* new_theme, |
| 36 | Profile* profile); |
| 37 | |
| 38 | // Returns the delegate to control the browser's info bar. This is |
| 39 | // within its own function due to its platform-specific nature. |
| 40 | static InfoBarDelegate* GetNewThemeInstalledInfoBarDelegate( |
[email protected] | 591a59f | 2012-10-11 01:16:23 | [diff] [blame] | 41 | content::WebContents* web_contents, |
[email protected] | c82da8c4 | 2012-06-08 19:49:11 | [diff] [blame] | 42 | const extensions::Extension* new_theme, |
| 43 | const std::string& previous_theme_id, |
| 44 | bool previous_using_native_theme); |
| 45 | |
[email protected] | c82da8c4 | 2012-06-08 19:49:11 | [diff] [blame] | 46 | // Whether or not to show the default UI after completing the installation. |
| 47 | bool skip_post_install_ui_; |
| 48 | |
| 49 | // Used to undo theme installation. |
| 50 | std::string previous_theme_id_; |
| 51 | bool previous_using_native_theme_; |
| 52 | |
| 53 | // Whether to show an installed bubble on app install, or use the default |
| 54 | // action of opening a new tab page. |
| 55 | bool use_app_installed_bubble_; |
| 56 | |
| 57 | DISALLOW_IMPLICIT_CONSTRUCTORS(ExtensionInstallUIDefault); |
| 58 | }; |
| 59 | |
| 60 | #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_DEFAULT_H_ |