1 // Copyright (c) 2013 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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_DEV_MODE_BUBBLE_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_DEV_MODE_BUBBLE_CONTROLLER_H_
9 #include "chrome/browser/extensions/extension_message_bubble_controller.h"
10 #include "content/public/browser/notification_observer.h"
11 #include "content/public/browser/notification_registrar.h"
12 #include "extensions/common/extension.h"
15 class ExtensionService
;
17 using extensions::ExtensionMessageBubbleController
;
21 class DevModeBubbleDelegate
22 : public ExtensionMessageBubbleController::Delegate
{
24 explicit DevModeBubbleDelegate(ExtensionService
* service
);
25 virtual ~DevModeBubbleDelegate();
27 // ExtensionMessageBubbleController::Delegate methods.
28 virtual bool ShouldIncludeExtension(const std::string
& extension_id
) OVERRIDE
;
29 virtual void AcknowledgeExtension(
30 const std::string
& extension_id
,
31 ExtensionMessageBubbleController::BubbleAction user_action
) OVERRIDE
;
32 virtual void PerformAction(const extensions::ExtensionIdList
& list
) OVERRIDE
;
33 virtual base::string16
GetTitle() const OVERRIDE
;
34 virtual base::string16
GetMessageBody() const OVERRIDE
;
35 virtual base::string16
GetOverflowText(
36 const base::string16
& overflow_count
) const OVERRIDE
;
37 virtual base::string16
GetLearnMoreLabel() const OVERRIDE
;
38 virtual GURL
GetLearnMoreUrl() const OVERRIDE
;
39 virtual base::string16
GetActionButtonLabel() const OVERRIDE
;
40 virtual base::string16
GetDismissButtonLabel() const OVERRIDE
;
41 virtual bool ShouldShowExtensionList() const OVERRIDE
;
42 virtual void LogExtensionCount(size_t count
) OVERRIDE
;
43 virtual void LogAction(
44 ExtensionMessageBubbleController::BubbleAction action
) OVERRIDE
;
47 // Our extension service. Weak, not owned by us.
48 ExtensionService
* service_
;
50 DISALLOW_COPY_AND_ASSIGN(DevModeBubbleDelegate
);
55 namespace extensions
{
59 class DevModeBubbleController
60 : public ExtensionMessageBubbleController
{
62 // Clears the list of profiles the bubble has been shown for. Should only be
63 // used during testing.
64 static void ClearProfileListForTesting();
66 // Returns true if the extension is considered a Developer Mode extension.
67 static bool IsDevModeExtension(const Extension
* extension
);
69 explicit DevModeBubbleController(Profile
* profile
);
70 virtual ~DevModeBubbleController();
72 // Whether the controller knows of extensions to list in the bubble. Returns
76 // ExtensionMessageBubbleController methods.
77 virtual void Show(ExtensionMessageBubble
* bubble
) OVERRIDE
;
80 // A weak pointer to the profile we are associated with. Not owned by us.
83 DISALLOW_COPY_AND_ASSIGN(DevModeBubbleController
);
86 } // namespace extensions
88 #endif // CHROME_BROWSER_EXTENSIONS_DEV_MODE_BUBBLE_CONTROLLER_H_