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

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

Issue 9718008: Replace extension disabled infobar with a global error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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_disabled_ui.h
diff --git a/chrome/browser/extensions/extension_disabled_ui.h b/chrome/browser/extensions/extension_disabled_ui.h
new file mode 100644
index 0000000000000000000000000000000000000000..127e09093b972859a432c5b3d8aebf3315ff81ee
--- /dev/null
+++ b/chrome/browser/extensions/extension_disabled_ui.h
@@ -0,0 +1,73 @@
+// 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_DISABLED_UI_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_DISABLED_UI_H_
+#pragma once
+
+#include "chrome/browser/extensions/extension_uninstall_dialog.h"
+#include "chrome/browser/ui/global_error.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+
+class Browser;
+class Extension;
+class ExtensionService;
+class Profile;
+
+class ExtensionDisabledGlobalError : public GlobalError,
Matt Perry 2012/03/16 23:52:06 Can this go in the .cc file? It's not part of the
Yoyo Zhou 2012/03/20 07:04:08 Done.
+ public content::NotificationObserver,
+ public ExtensionUninstallDialog::Delegate {
+ public:
+ ExtensionDisabledGlobalError(ExtensionService* service,
+ const Extension* extension);
+ virtual ~ExtensionDisabledGlobalError();
+
+ // GlobalError implementation.
+ virtual bool HasBadge() OVERRIDE;
+ virtual bool HasMenuItem() OVERRIDE;
+ virtual int MenuItemCommandID() OVERRIDE;
+ virtual string16 MenuItemLabel() OVERRIDE;
+ virtual void ExecuteMenuItem(Browser* browser) OVERRIDE;
+ virtual bool HasBubbleView() OVERRIDE;
+ virtual string16 GetBubbleViewTitle() OVERRIDE;
+ virtual string16 GetBubbleViewMessage() OVERRIDE;
+ virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE;
+ virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE;
+ virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE;
+ virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE;
+ virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE;
+
+ // ExtensionUninstallDialog::Delegate implementation.
+ virtual void ExtensionUninstallAccepted() OVERRIDE;
+ virtual void ExtensionUninstallCanceled() OVERRIDE;
+
+ // content::NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ private:
+ ExtensionService* service_;
+ const Extension* extension_;
+
+ scoped_ptr<ExtensionUninstallDialog> uninstall_dialog_;
+
+ content::NotificationRegistrar registrar_;
+};
+
+namespace extensions {
+
+// Shows UI to inform the user that an extension was disabled after upgrading
+// to higher permissions.
+void ShowExtensionDisabledUI(ExtensionService* service, Profile* profile,
+ const Extension* extension);
+
+// Shows the extension install dialog.
+void ShowExtensionDisabledDialog(ExtensionService* service, Profile* profile,
+ const Extension* extension);
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DISABLED_UI_H_

Powered by Google App Engine
This is Rietveld 408576698