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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_DELEGAT E_H_
6 #define CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_DELEGAT E_H_
7
8 #include <string>
9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
10 #include "chrome/browser/extensions/extension_message_bubble_controller.h"
11 #include "extensions/common/extension.h"
12
13 class Browser;
14 class ExtensionService;
15
16 namespace extensions {
17
18 class SuspiciousExtensionBubble;
19
20 class SuspiciousExtensionBubbleControllerDelegate
21 : public ProfileKeyedAPI,
22 public ExtensionMessageBubbleController::Delegate {
23 public:
24 explicit SuspiciousExtensionBubbleControllerDelegate(Profile* profile);
25 virtual ~SuspiciousExtensionBubbleControllerDelegate();
26
27 // ProfileKeyedAPI implementation.
28 static ProfileKeyedAPIFactory<
29 SuspiciousExtensionBubbleControllerDelegate>* GetFactoryInstance();
30
31 // Convenience method to get the SuspiciousExtensionBubbleControllerDelegate
32 // for a profile.
33 static SuspiciousExtensionBubbleControllerDelegate* Get(Profile* profile);
34
35 // ExtensionMessageBubbleController::Delegate methods.
36 virtual void Show(ExtensionMessageBubble* bubble) OVERRIDE;
37 virtual bool ShowingBubble() const OVERRIDE;
38 virtual bool HasExtensionList() const OVERRIDE;
39 virtual std::vector<string16> GetExtensionList() const OVERRIDE;
40 virtual const ExtensionIdList& GetExtensionIdList() const OVERRIDE;
41 virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE;
42 virtual void AcknowledgeExtension(
43 const std::string& extension_id,
44 ExtensionMessageBubbleController::BubbleAction user_action) OVERRIDE;
45 virtual void PerformAction(const ExtensionIdList& list) OVERRIDE;
46 virtual string16 GetTitle() const OVERRIDE;
47 virtual string16 GetMessageBody() const OVERRIDE;
48 virtual string16 GetOverflowText(
49 const string16& overflow_count) const OVERRIDE;
50 virtual string16 GetLearnMoreLabel() const OVERRIDE;
51 virtual GURL GetLearnMoreUrl() const OVERRIDE;
52 virtual string16 GetActionButtonLabel() const OVERRIDE;
53 virtual string16 GetDismissButtonLabel() const OVERRIDE;
54 virtual bool ShouldShowExtensionList() const OVERRIDE;
55 virtual void LogExtensionCount(size_t count) OVERRIDE;
56 virtual void LogAction(
57 ExtensionMessageBubbleController::BubbleAction action) OVERRIDE;
58
59 private:
60 friend class ProfileKeyedAPIFactory<
61 SuspiciousExtensionBubbleControllerDelegate>;
62
63 // ProfileKeyedAPI implementation.
64 static const char* service_name() {
65 return "SuspiciousExtensionBubbleControllerDelegate";
66 }
67 static const bool kServiceRedirectedInIncognito = true;
68
69 scoped_ptr<ExtensionMessageBubbleController> controller_;
70
71 // Our extension service. Weak, not owned by us.
72 ExtensionService* service_;
73
74 // A weak pointer to the profile we are associated with. Not owned by us.
75 Profile* profile_;
76
77 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleControllerDelegate);
78 };
79
80 template <>
81 void ProfileKeyedAPIFactory<
82 SuspiciousExtensionBubbleControllerDelegate>::DeclareFactoryDependencies();
83
84 } // namespace extensions
85
86 #endif // CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_DELE GATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698