Index: chrome/browser/extensions/dev_mode_bubble_controller_delegate.h |
diff --git a/chrome/browser/extensions/dev_mode_bubble_controller_delegate.h b/chrome/browser/extensions/dev_mode_bubble_controller_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c5459e8d281d4251b86588c78c4139a63706c7c2 |
--- /dev/null |
+++ b/chrome/browser/extensions/dev_mode_bubble_controller_delegate.h |
@@ -0,0 +1,91 @@ |
+// 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_DEV_MODE_BUBBLE_CONTROLLER_DELEGATE_H_ |
+#define CHROME_BROWSER_EXTENSIONS_DEV_MODE_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 "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
+#include "extensions/common/extension.h" |
+ |
+class Browser; |
+class ExtensionService; |
+ |
+namespace extensions { |
+ |
+class DevModeBubble; |
+ |
+class DevModeBubbleControllerDelegate |
+ : public ProfileKeyedAPI, |
+ public ExtensionMessageBubbleController::Delegate { |
+ public: |
+ explicit DevModeBubbleControllerDelegate(Profile* profile); |
+ virtual ~DevModeBubbleControllerDelegate(); |
+ |
+ // ProfileKeyedAPI implementation. |
+ static ProfileKeyedAPIFactory< |
+ DevModeBubbleControllerDelegate>* GetFactoryInstance(); |
+ |
+ // Convenience method to get the DevModeBubbleControllerDelegate for a |
+ // profile. |
+ static DevModeBubbleControllerDelegate* Get(Profile* profile); |
+ |
+ // Returns true if the extension is considered a Developer Mode extension. |
+ bool IsDevModeExtension(const Extension* extension) const; |
+ |
+ // 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<DevModeBubbleControllerDelegate>; |
+ |
+ // ProfileKeyedAPI implementation. |
+ static const char* service_name() { |
+ return "DevModeBubbleControllerDelegate"; |
+ } |
+ 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(DevModeBubbleControllerDelegate); |
+}; |
+ |
+template <> |
+void ProfileKeyedAPIFactory< |
+ DevModeBubbleControllerDelegate>::DeclareFactoryDependencies(); |
+ |
+} // namespace extensions |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_DEV_MODE_BUBBLE_CONTROLLER_DELEGATE_H_ |