Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2390)

Unified Diff: chrome/browser/extensions/extension_install_ui_default.h

Issue 10388252: Refactoring ExtenionInstallUI to abstract the Browser references. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor clean-ups Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_install_ui_default.h
diff --git a/chrome/browser/extensions/extension_install_ui_default.h b/chrome/browser/extensions/extension_install_ui_default.h
new file mode 100644
index 0000000000000000000000000000000000000000..fe92b2a0eab3bdff3d22f16bf05b9ca28b1dd008
--- /dev/null
+++ b/chrome/browser/extensions/extension_install_ui_default.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_DEFAULT_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_DEFAULT_H_
+#pragma once
+
+#include "chrome/browser/extensions/extension_install_ui.h"
+
+class InfoBarDelegate;
+class TabContentsWrapper;
+
+class ExtensionInstallUIDefault : public ExtensionInstallUI {
+ public:
+ explicit ExtensionInstallUIDefault(Profile* profile);
+ virtual ~ExtensionInstallUIDefault();
+
+ virtual void OnInstallSuccess(const extensions::Extension* extension,
+ SkBitmap* icon);
+ virtual void OnInstallFailure(const string16& error);
+
+ private:
+ // Shows an infobar for a newly-installed theme. previous_theme_id should be
+ // empty if the previous theme was the system/default theme.
+ static void ShowThemeInfoBar(const std::string& previous_theme_id,
+ bool previous_using_native_theme,
+ const extensions::Extension* new_theme,
+ Profile* profile);
+
+ // Returns the delegate to control the browser's info bar. This is
+ // within its own function due to its platform-specific nature.
+ static InfoBarDelegate* GetNewThemeInstalledInfoBarDelegate(
+ TabContentsWrapper* tab_contents,
+ const extensions::Extension* new_theme,
+ const std::string& previous_theme_id,
+ bool previous_using_native_theme);
+
+ // Used to undo theme installation.
+ std::string previous_theme_id_;
+ bool previous_using_native_theme_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ExtensionInstallUIDefault);
+};
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_DEFAULT_H_

Powered by Google App Engine
This is Rietveld 408576698