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

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

Issue 95133002: Add an extension bubble explaining which extensions are in dev mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 7 years 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/suspicious_extension_bubble_controller_delegate.h
diff --git a/chrome/browser/extensions/suspicious_extension_bubble_controller_delegate.h b/chrome/browser/extensions/suspicious_extension_bubble_controller_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..dc41eba2c0dba0b327c3859ce908fc6a222e5fc6
--- /dev/null
+++ b/chrome/browser/extensions/suspicious_extension_bubble_controller_delegate.h
@@ -0,0 +1,86 @@
+// Copyright (c) 2013 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_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_DELEGATE_H_
+#define CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_DELEGATE_H_
+
+#include <string>
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
+#include "chrome/browser/extensions/extension_message_bubble_controller.h"
+#include "extensions/common/extension.h"
+
+class Browser;
+class ExtensionService;
+
+namespace extensions {
+
+class SuspiciousExtensionBubble;
+
+class SuspiciousExtensionBubbleControllerDelegate
+ : public ProfileKeyedAPI,
+ public ExtensionMessageBubbleController::Delegate {
+ public:
+ explicit SuspiciousExtensionBubbleControllerDelegate(Profile* profile);
+ virtual ~SuspiciousExtensionBubbleControllerDelegate();
+
+ // ProfileKeyedAPI implementation.
+ static ProfileKeyedAPIFactory<
+ SuspiciousExtensionBubbleControllerDelegate>* GetFactoryInstance();
+
+ // Convenience method to get the SuspiciousExtensionBubbleControllerDelegate
+ // for a profile.
+ static SuspiciousExtensionBubbleControllerDelegate* Get(Profile* profile);
+
+ // ExtensionMessageBubbleController::Delegate methods.
+ virtual void Show(ExtensionMessageBubble* bubble) OVERRIDE;
+ virtual bool ShowingBubble() const OVERRIDE;
+ virtual bool HasExtensionList() const OVERRIDE;
+ virtual std::vector<string16> GetExtensionList() const OVERRIDE;
+ virtual const ExtensionIdList& GetExtensionIdList() const OVERRIDE;
+ virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE;
+ virtual void AcknowledgeExtension(
+ const std::string& extension_id,
+ ExtensionMessageBubbleController::BubbleAction user_action) OVERRIDE;
+ virtual void PerformAction(const ExtensionIdList& list) OVERRIDE;
+ virtual string16 GetTitle() const OVERRIDE;
+ virtual string16 GetMessageBody() const OVERRIDE;
+ virtual string16 GetOverflowText(
+ const string16& overflow_count) const OVERRIDE;
+ virtual string16 GetLearnMoreLabel() const OVERRIDE;
+ virtual GURL GetLearnMoreUrl() const OVERRIDE;
+ virtual string16 GetActionButtonLabel() const OVERRIDE;
+ virtual string16 GetDismissButtonLabel() const OVERRIDE;
+ virtual bool ShouldShowExtensionList() const OVERRIDE;
+ virtual void LogExtensionCount(size_t count) OVERRIDE;
+ virtual void LogAction(
+ ExtensionMessageBubbleController::BubbleAction action) OVERRIDE;
+
+ private:
+ friend class ProfileKeyedAPIFactory<
+ SuspiciousExtensionBubbleControllerDelegate>;
+
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "SuspiciousExtensionBubbleControllerDelegate";
+ }
+ static const bool kServiceRedirectedInIncognito = true;
+
+ scoped_ptr<ExtensionMessageBubbleController> controller_;
+
+ // Our extension service. Weak, not owned by us.
+ ExtensionService* service_;
+
+ // A weak pointer to the profile we are associated with. Not owned by us.
+ Profile* profile_;
+
+ DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleControllerDelegate);
+};
+
+template <>
+void ProfileKeyedAPIFactory<
+ SuspiciousExtensionBubbleControllerDelegate>::DeclareFactoryDependencies();
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698