Chromium Code Reviews| Index: chrome/browser/extensions/suspicious_extension_bubble_controller.h |
| diff --git a/chrome/browser/extensions/suspicious_extension_bubble_controller.h b/chrome/browser/extensions/suspicious_extension_bubble_controller.h |
| index 9c970085166d4df4d81edef08c35aed7e113dde6..9b9bc0d04da91c8bcb35ddfd677afe0315278ddc 100644 |
| --- a/chrome/browser/extensions/suspicious_extension_bubble_controller.h |
| +++ b/chrome/browser/extensions/suspicious_extension_bubble_controller.h |
| @@ -17,21 +17,11 @@ namespace extensions { |
| class SuspiciousExtensionBubble; |
| -class SuspiciousExtensionBubbleController |
| - : public ProfileKeyedAPI, |
| - public ExtensionMessageBubbleController, |
| - public ExtensionMessageBubbleController::Delegate { |
| +class SuspiciousExtensionBubbleDelegate |
|
not at google - send to devlin
2014/01/10 21:28:43
same comments here as in the other file (move this
Finnur
2014/01/13 15:36:32
Done.
|
| + : public ExtensionMessageBubbleController::Delegate { |
| public: |
| - explicit SuspiciousExtensionBubbleController(Profile* profile); |
| - virtual ~SuspiciousExtensionBubbleController(); |
| - |
| - // ProfileKeyedAPI implementation. |
| - static ProfileKeyedAPIFactory< |
| - SuspiciousExtensionBubbleController>* GetFactoryInstance(); |
| - |
| - // Convenience method to get the SuspiciousExtensionBubbleController |
| - // for a profile. |
| - static SuspiciousExtensionBubbleController* Get(Profile* profile); |
| + explicit SuspiciousExtensionBubbleDelegate(Profile* profile); |
| + virtual ~SuspiciousExtensionBubbleDelegate(); |
| // ExtensionMessageBubbleController::Delegate methods. |
| virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE; |
| @@ -48,33 +38,43 @@ class SuspiciousExtensionBubbleController |
| virtual base::string16 GetActionButtonLabel() const OVERRIDE; |
| virtual base::string16 GetDismissButtonLabel() const OVERRIDE; |
| virtual bool ShouldShowExtensionList() const OVERRIDE; |
| - virtual std::vector<base::string16> GetExtensions() OVERRIDE; |
| virtual void LogExtensionCount(size_t count) OVERRIDE; |
| virtual void LogAction( |
| ExtensionMessageBubbleController::BubbleAction action) OVERRIDE; |
| - private: |
| - friend class ProfileKeyedAPIFactory< |
| - SuspiciousExtensionBubbleController>; |
| - |
| - // ProfileKeyedAPI implementation. |
| - static const char* service_name() { |
| - return "SuspiciousExtensionBubbleController"; |
| - } |
| - static const bool kServiceRedirectedInIncognito = true; |
| + private: |
| // Our extension service. Weak, not owned by us. |
| ExtensionService* service_; |
| + DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate); |
| +}; |
| + |
| +class SuspiciousExtensionBubbleController |
| + : public ExtensionMessageBubbleController { |
| + public: |
| + explicit SuspiciousExtensionBubbleController(Profile* profile); |
| + virtual ~SuspiciousExtensionBubbleController(); |
| + |
| + // Whether the controller knows of extensions to list in the bubble. Returns |
| + // true if so. |
| + bool ShouldShow(); |
| + |
| + // ExtensionMessageBubbleController methods. |
| + virtual void Show(ExtensionMessageBubble* bubble) OVERRIDE; |
| + |
| + private: |
| + FRIEND_TEST_ALL_PREFIXES(ExtensionMessageBubbleTest, WipeoutControllerTest); |
| + |
| + // Clears the list of profiles the bubble has been shown for. Should only be |
| + // used during testing. |
| + void ClearProfileListForTesting(); |
| + |
| // A weak pointer to the profile we are associated with. Not owned by us. |
| Profile* profile_; |
| DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleController); |
| }; |
| -template <> |
| -void ProfileKeyedAPIFactory< |
| - SuspiciousExtensionBubbleController>::DeclareFactoryDependencies(); |
| - |
| } // namespace extensions |
| #endif // CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_ |