Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / extensions / suspicious_extension_bubble_controller.h
blob9ed5c90c1a34d38b1045d9568ab312b10a0663f7
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_
8 #include <string>
10 #include "chrome/browser/extensions/extension_message_bubble_controller.h"
11 #include "extensions/common/extension.h"
13 class Browser;
14 class ExtensionService;
15 class Profile;
17 using extensions::ExtensionMessageBubbleController;
19 namespace {
21 class SuspiciousExtensionBubbleDelegate
22 : public ExtensionMessageBubbleController::Delegate {
23 public:
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;
46 private:
47 // Our profile. Weak, not owned by us.
48 Profile* profile_;
50 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate);
53 } // namespace
55 namespace extensions {
57 class SuspiciousExtensionBubble;
59 class SuspiciousExtensionBubbleController
60 : public ExtensionMessageBubbleController {
61 public:
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
70 // true if so.
71 bool ShouldShow();
73 // ExtensionMessageBubbleController methods.
74 virtual void Show(ExtensionMessageBubble* bubble) OVERRIDE;
76 private:
77 // A weak pointer to the profile we are associated with. Not owned by us.
78 Profile* profile_;
80 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleController);
83 } // namespace extensions
85 #endif // CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_