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_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_
10 #include "chrome/browser/extensions/extension_message_bubble_controller.h"
11 #include "extensions/common/extension.h"
14 class ExtensionService
;
17 using extensions::ExtensionMessageBubbleController
;
21 class SuspiciousExtensionBubbleDelegate
22 : public ExtensionMessageBubbleController::Delegate
{
24 explicit SuspiciousExtensionBubbleDelegate(Profile
* profile
);
25 virtual ~SuspiciousExtensionBubbleDelegate();
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 profile. Weak, not owned by us.
50 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate
);
55 namespace extensions
{
57 class SuspiciousExtensionBubble
;
59 class SuspiciousExtensionBubbleController
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 explicit SuspiciousExtensionBubbleController(Profile
* profile
);
67 virtual ~SuspiciousExtensionBubbleController();
69 // Whether the controller knows of extensions to list in the bubble. Returns
73 // ExtensionMessageBubbleController methods.
74 virtual void Show(ExtensionMessageBubble
* bubble
) OVERRIDE
;
77 // A weak pointer to the profile we are associated with. Not owned by us.
80 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleController
);
83 } // namespace extensions
85 #endif // CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_