| 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_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 9 |
| 10 #include "chrome/browser/extensions/extension_message_bubble_controller.h" | 10 #include "chrome/browser/extensions/extension_message_bubble_controller.h" |
| 11 #include "extensions/common/extension.h" | 11 #include "extensions/common/extension.h" |
| 12 | 12 |
| 13 class Browser; | 13 class Browser; |
| 14 class ExtensionService; | 14 class ExtensionService; |
| 15 class Profile; |
| 15 | 16 |
| 16 using extensions::ExtensionMessageBubbleController; | 17 using extensions::ExtensionMessageBubbleController; |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 class SuspiciousExtensionBubbleDelegate | 21 class SuspiciousExtensionBubbleDelegate |
| 21 : public ExtensionMessageBubbleController::Delegate { | 22 : public ExtensionMessageBubbleController::Delegate { |
| 22 public: | 23 public: |
| 23 explicit SuspiciousExtensionBubbleDelegate(ExtensionService* service); | 24 explicit SuspiciousExtensionBubbleDelegate(Profile* profile); |
| 24 virtual ~SuspiciousExtensionBubbleDelegate(); | 25 virtual ~SuspiciousExtensionBubbleDelegate(); |
| 25 | 26 |
| 26 // ExtensionMessageBubbleController::Delegate methods. | 27 // ExtensionMessageBubbleController::Delegate methods. |
| 27 virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE; | 28 virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE; |
| 28 virtual void AcknowledgeExtension( | 29 virtual void AcknowledgeExtension( |
| 29 const std::string& extension_id, | 30 const std::string& extension_id, |
| 30 ExtensionMessageBubbleController::BubbleAction user_action) OVERRIDE; | 31 ExtensionMessageBubbleController::BubbleAction user_action) OVERRIDE; |
| 31 virtual void PerformAction(const extensions::ExtensionIdList& list) OVERRIDE; | 32 virtual void PerformAction(const extensions::ExtensionIdList& list) OVERRIDE; |
| 32 virtual base::string16 GetTitle() const OVERRIDE; | 33 virtual base::string16 GetTitle() const OVERRIDE; |
| 33 virtual base::string16 GetMessageBody() const OVERRIDE; | 34 virtual base::string16 GetMessageBody() const OVERRIDE; |
| 34 virtual base::string16 GetOverflowText( | 35 virtual base::string16 GetOverflowText( |
| 35 const base::string16& overflow_count) const OVERRIDE; | 36 const base::string16& overflow_count) const OVERRIDE; |
| 36 virtual base::string16 GetLearnMoreLabel() const OVERRIDE; | 37 virtual base::string16 GetLearnMoreLabel() const OVERRIDE; |
| 37 virtual GURL GetLearnMoreUrl() const OVERRIDE; | 38 virtual GURL GetLearnMoreUrl() const OVERRIDE; |
| 38 virtual base::string16 GetActionButtonLabel() const OVERRIDE; | 39 virtual base::string16 GetActionButtonLabel() const OVERRIDE; |
| 39 virtual base::string16 GetDismissButtonLabel() const OVERRIDE; | 40 virtual base::string16 GetDismissButtonLabel() const OVERRIDE; |
| 40 virtual bool ShouldShowExtensionList() const OVERRIDE; | 41 virtual bool ShouldShowExtensionList() const OVERRIDE; |
| 41 virtual void LogExtensionCount(size_t count) OVERRIDE; | 42 virtual void LogExtensionCount(size_t count) OVERRIDE; |
| 42 virtual void LogAction( | 43 virtual void LogAction( |
| 43 ExtensionMessageBubbleController::BubbleAction action) OVERRIDE; | 44 ExtensionMessageBubbleController::BubbleAction action) OVERRIDE; |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 // Our extension service. Weak, not owned by us. | 47 // Our profile. Weak, not owned by us. |
| 47 ExtensionService* service_; | 48 Profile* profile_; |
| 48 | 49 |
| 49 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate); | 50 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate); |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 } // namespace | 53 } // namespace |
| 53 | 54 |
| 54 namespace extensions { | 55 namespace extensions { |
| 55 | 56 |
| 56 class SuspiciousExtensionBubble; | 57 class SuspiciousExtensionBubble; |
| 57 | 58 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 75 private: | 76 private: |
| 76 // A weak pointer to the profile we are associated with. Not owned by us. | 77 // A weak pointer to the profile we are associated with. Not owned by us. |
| 77 Profile* profile_; | 78 Profile* profile_; |
| 78 | 79 |
| 79 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleController); | 80 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleController); |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 } // namespace extensions | 83 } // namespace extensions |
| 83 | 84 |
| 84 #endif // CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_ | 85 #endif // CHROME_BROWSER_EXTENSIONS_SUSPICIOUS_EXTENSION_BUBBLE_CONTROLLER_H_ |
| OLD | NEW |