| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |