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