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

Side by Side Diff: chrome/browser/extensions/extension_message_bubble_controller.h

Issue 1087713002: [Reland] [Extensions] Make extension message bubble factory platform-abstract (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finnur's Created 5 years, 8 months 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_CONTROLLER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_CONTROLLER_H_
7 7
8 #include <string> 8 #include <string>
9 #include "chrome/browser/extensions/extension_message_bubble.h" 9 #include "chrome/browser/extensions/extension_message_bubble.h"
10 #include "extensions/browser/browser_context_keyed_api_factory.h" 10 #include "extensions/browser/browser_context_keyed_api_factory.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 virtual base::string16 GetOverflowText( 52 virtual base::string16 GetOverflowText(
53 const base::string16& overflow_count) const = 0; 53 const base::string16& overflow_count) const = 0;
54 virtual base::string16 GetLearnMoreLabel() const; 54 virtual base::string16 GetLearnMoreLabel() const;
55 virtual GURL GetLearnMoreUrl() const = 0; 55 virtual GURL GetLearnMoreUrl() const = 0;
56 virtual base::string16 GetActionButtonLabel() const = 0; 56 virtual base::string16 GetActionButtonLabel() const = 0;
57 virtual base::string16 GetDismissButtonLabel() const = 0; 57 virtual base::string16 GetDismissButtonLabel() const = 0;
58 58
59 // Whether to show a list of extensions in the bubble. 59 // Whether to show a list of extensions in the bubble.
60 virtual bool ShouldShowExtensionList() const = 0; 60 virtual bool ShouldShowExtensionList() const = 0;
61 61
62 // Returns true if the set of affected extensions should be highlighted in
63 // the toolbar.
64 virtual bool ShouldHighlightExtensions() const = 0;
65
62 // In some cases, we want the delegate only to handle a single extension 66 // In some cases, we want the delegate only to handle a single extension
63 // and this sets which extension. 67 // and this sets which extension.
64 virtual void RestrictToSingleExtension(const std::string& extension_id); 68 virtual void RestrictToSingleExtension(const std::string& extension_id);
65 69
66 // Record, through UMA, how many extensions were found. 70 // Record, through UMA, how many extensions were found.
67 virtual void LogExtensionCount(size_t count) = 0; 71 virtual void LogExtensionCount(size_t count) = 0;
68 virtual void LogAction(BubbleAction action) = 0; 72 virtual void LogAction(BubbleAction action) = 0;
69 73
70 // Has the user acknowledged info about the extension the bubble reports. 74 // Has the user acknowledged info about the extension the bubble reports.
71 virtual bool HasBubbleInfoBeenAcknowledged(const std::string& extension_id); 75 virtual bool HasBubbleInfoBeenAcknowledged(const std::string& extension_id);
(...skipping 22 matching lines...) Expand all
94 98
95 // Obtains a list of all extensions (by name) the controller knows about. 99 // Obtains a list of all extensions (by name) the controller knows about.
96 std::vector<base::string16> GetExtensionList(); 100 std::vector<base::string16> GetExtensionList();
97 101
98 // Obtains a list of all extensions (by id) the controller knows about. 102 // Obtains a list of all extensions (by id) the controller knows about.
99 const ExtensionIdList& GetExtensionIdList(); 103 const ExtensionIdList& GetExtensionIdList();
100 104
101 // Whether to close the bubble when it loses focus. 105 // Whether to close the bubble when it loses focus.
102 virtual bool CloseOnDeactivate(); 106 virtual bool CloseOnDeactivate();
103 107
108 // Highlights the affected extensions if appropriate.
109 void HighlightExtensionsIfNecessary();
110
104 // Sets up the callbacks and shows the bubble. 111 // Sets up the callbacks and shows the bubble.
105 virtual void Show(ExtensionMessageBubble* bubble); 112 virtual void Show(ExtensionMessageBubble* bubble);
106 113
107 // Callbacks from bubble. Declared virtual for testing purposes. 114 // Callbacks from bubble. Declared virtual for testing purposes.
108 virtual void OnBubbleAction(); 115 virtual void OnBubbleAction();
109 virtual void OnBubbleDismiss(); 116 virtual void OnBubbleDismiss();
110 virtual void OnLinkClicked(); 117 virtual void OnLinkClicked();
111 118
112 private: 119 private:
113 // Iterate over the known extensions and acknowledge each one. 120 // Iterate over the known extensions and acknowledge each one.
(...skipping 16 matching lines...) Expand all
130 137
131 // Whether this class has initialized. 138 // Whether this class has initialized.
132 bool initialized_; 139 bool initialized_;
133 140
134 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleController); 141 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleController);
135 }; 142 };
136 143
137 } // namespace extensions 144 } // namespace extensions
138 145
139 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_CONTROLLER_H_ 146 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_BUBBLE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_message_bubble.h ('k') | chrome/browser/extensions/extension_message_bubble_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698