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 #include "chrome/browser/extensions/suspicious_extension_bubble_controller.h" | 5 #include "chrome/browser/extensions/suspicious_extension_bubble_controller.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/extensions/extension_message_bubble.h" | 10 #include "chrome/browser/extensions/extension_message_bubble.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 //////////////////////////////////////////////////////////////////////////////// | 30 //////////////////////////////////////////////////////////////////////////////// |
31 // SuspiciousExtensionBubbleDelegate | 31 // SuspiciousExtensionBubbleDelegate |
32 | 32 |
33 class SuspiciousExtensionBubbleDelegate | 33 class SuspiciousExtensionBubbleDelegate |
34 : public ExtensionMessageBubbleController::Delegate { | 34 : public ExtensionMessageBubbleController::Delegate { |
35 public: | 35 public: |
36 explicit SuspiciousExtensionBubbleDelegate(Profile* profile); | 36 explicit SuspiciousExtensionBubbleDelegate(Profile* profile); |
37 virtual ~SuspiciousExtensionBubbleDelegate(); | 37 virtual ~SuspiciousExtensionBubbleDelegate(); |
38 | 38 |
39 // ExtensionMessageBubbleController::Delegate methods. | 39 // ExtensionMessageBubbleController::Delegate methods. |
40 virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE; | 40 virtual bool ShouldIncludeExtension(const std::string& extension_id) override; |
41 virtual void AcknowledgeExtension( | 41 virtual void AcknowledgeExtension( |
42 const std::string& extension_id, | 42 const std::string& extension_id, |
43 ExtensionMessageBubbleController::BubbleAction user_action) OVERRIDE; | 43 ExtensionMessageBubbleController::BubbleAction user_action) override; |
44 virtual void PerformAction(const extensions::ExtensionIdList& list) OVERRIDE; | 44 virtual void PerformAction(const extensions::ExtensionIdList& list) override; |
45 virtual base::string16 GetTitle() const OVERRIDE; | 45 virtual base::string16 GetTitle() const override; |
46 virtual base::string16 GetMessageBody( | 46 virtual base::string16 GetMessageBody( |
47 bool anchored_to_browser_action) const OVERRIDE; | 47 bool anchored_to_browser_action) const override; |
48 virtual base::string16 GetOverflowText( | 48 virtual base::string16 GetOverflowText( |
49 const base::string16& overflow_count) const OVERRIDE; | 49 const base::string16& overflow_count) const override; |
50 virtual base::string16 GetLearnMoreLabel() const OVERRIDE; | 50 virtual base::string16 GetLearnMoreLabel() const override; |
51 virtual GURL GetLearnMoreUrl() const OVERRIDE; | 51 virtual GURL GetLearnMoreUrl() const override; |
52 virtual base::string16 GetActionButtonLabel() const OVERRIDE; | 52 virtual base::string16 GetActionButtonLabel() const override; |
53 virtual base::string16 GetDismissButtonLabel() const OVERRIDE; | 53 virtual base::string16 GetDismissButtonLabel() const override; |
54 virtual bool ShouldShowExtensionList() const OVERRIDE; | 54 virtual bool ShouldShowExtensionList() const override; |
55 virtual void LogExtensionCount(size_t count) OVERRIDE; | 55 virtual void LogExtensionCount(size_t count) override; |
56 virtual void LogAction( | 56 virtual void LogAction( |
57 ExtensionMessageBubbleController::BubbleAction action) OVERRIDE; | 57 ExtensionMessageBubbleController::BubbleAction action) override; |
58 | 58 |
59 private: | 59 private: |
60 // Our profile. Weak, not owned by us. | 60 // Our profile. Weak, not owned by us. |
61 Profile* profile_; | 61 Profile* profile_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate); | 63 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate); |
64 }; | 64 }; |
65 | 65 |
66 SuspiciousExtensionBubbleDelegate::SuspiciousExtensionBubbleDelegate( | 66 SuspiciousExtensionBubbleDelegate::SuspiciousExtensionBubbleDelegate( |
67 Profile* profile) | 67 Profile* profile) |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && | 176 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && |
177 !GetExtensionList().empty(); | 177 !GetExtensionList().empty(); |
178 } | 178 } |
179 | 179 |
180 void SuspiciousExtensionBubbleController::Show(ExtensionMessageBubble* bubble) { | 180 void SuspiciousExtensionBubbleController::Show(ExtensionMessageBubble* bubble) { |
181 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); | 181 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); |
182 ExtensionMessageBubbleController::Show(bubble); | 182 ExtensionMessageBubbleController::Show(bubble); |
183 } | 183 } |
184 | 184 |
185 } // namespace extensions | 185 } // namespace extensions |
OLD | NEW |