blob: 34069bc59575e3c33088e56fcc788845110488ad [file] [log] [blame]
[email protected]c82da8c42012-06-08 19:49:111// 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]c82da8c42012-06-08 19:49:117
8#include "chrome/browser/extensions/extension_install_ui.h"
9
10class InfoBarDelegate;
[email protected]32fc4ff72012-06-15 21:50:0111class Profile;
[email protected]591a59f2012-10-11 01:16:2312
13namespace content {
14class WebContents;
15}
[email protected]c82da8c42012-06-08 19:49:1116
17class ExtensionInstallUIDefault : public ExtensionInstallUI {
18 public:
[email protected]619f86182012-07-03 21:30:1819 explicit ExtensionInstallUIDefault(Profile* profile);
[email protected]c82da8c42012-06-08 19:49:1120 virtual ~ExtensionInstallUIDefault();
21
22 // ExtensionInstallUI implementation:
23 virtual void OnInstallSuccess(const extensions::Extension* extension,
24 SkBitmap* icon) OVERRIDE;
[email protected]bf3d9df2012-07-24 23:20:2725 virtual void OnInstallFailure(
26 const extensions::CrxInstallerError& error) OVERRIDE;
[email protected]c82da8c42012-06-08 19:49:1127 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]591a59f2012-10-11 01:16:2341 content::WebContents* web_contents,
[email protected]c82da8c42012-06-08 19:49:1142 const extensions::Extension* new_theme,
43 const std::string& previous_theme_id,
44 bool previous_using_native_theme);
45
[email protected]c82da8c42012-06-08 19:49:1146 // 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_