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

Side by Side Diff: chrome/browser/extensions/suspicious_extension_bubble_controller.cc

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 #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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 ExtensionMessageBubbleController::BubbleAction user_action) override; 46 ExtensionMessageBubbleController::BubbleAction user_action) override;
47 void PerformAction(const extensions::ExtensionIdList& list) override; 47 void PerformAction(const extensions::ExtensionIdList& list) override;
48 base::string16 GetTitle() const override; 48 base::string16 GetTitle() const override;
49 base::string16 GetMessageBody(bool anchored_to_browser_action) const override; 49 base::string16 GetMessageBody(bool anchored_to_browser_action) const override;
50 base::string16 GetOverflowText( 50 base::string16 GetOverflowText(
51 const base::string16& overflow_count) const override; 51 const base::string16& overflow_count) const override;
52 GURL GetLearnMoreUrl() const override; 52 GURL GetLearnMoreUrl() const override;
53 base::string16 GetActionButtonLabel() const override; 53 base::string16 GetActionButtonLabel() const override;
54 base::string16 GetDismissButtonLabel() const override; 54 base::string16 GetDismissButtonLabel() const override;
55 bool ShouldShowExtensionList() const override; 55 bool ShouldShowExtensionList() const override;
56 bool ShouldHighlightExtensions() const override;
56 void LogExtensionCount(size_t count) override; 57 void LogExtensionCount(size_t count) override;
57 void LogAction( 58 void LogAction(
58 ExtensionMessageBubbleController::BubbleAction action) override; 59 ExtensionMessageBubbleController::BubbleAction action) override;
59 60
60 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate); 61 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate);
61 }; 62 };
62 63
63 SuspiciousExtensionBubbleDelegate::SuspiciousExtensionBubbleDelegate( 64 SuspiciousExtensionBubbleDelegate::SuspiciousExtensionBubbleDelegate(
64 Profile* profile) 65 Profile* profile)
65 : extensions::ExtensionMessageBubbleController::Delegate(profile) { 66 : extensions::ExtensionMessageBubbleController::Delegate(profile) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 base::string16 120 base::string16
120 SuspiciousExtensionBubbleDelegate::GetActionButtonLabel() const { 121 SuspiciousExtensionBubbleDelegate::GetActionButtonLabel() const {
121 return base::string16(); 122 return base::string16();
122 } 123 }
123 124
124 base::string16 125 base::string16
125 SuspiciousExtensionBubbleDelegate::GetDismissButtonLabel() const { 126 SuspiciousExtensionBubbleDelegate::GetDismissButtonLabel() const {
126 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNSUPPORTED_DISABLED_BUTTON); 127 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNSUPPORTED_DISABLED_BUTTON);
127 } 128 }
128 129
129 bool 130 bool SuspiciousExtensionBubbleDelegate::ShouldShowExtensionList() const {
130 SuspiciousExtensionBubbleDelegate::ShouldShowExtensionList() const {
131 return true; 131 return true;
132 } 132 }
133 133
134 bool SuspiciousExtensionBubbleDelegate::ShouldHighlightExtensions() const {
135 return false;
136 }
137
134 void SuspiciousExtensionBubbleDelegate::LogExtensionCount( 138 void SuspiciousExtensionBubbleDelegate::LogExtensionCount(
135 size_t count) { 139 size_t count) {
136 UMA_HISTOGRAM_COUNTS_100( 140 UMA_HISTOGRAM_COUNTS_100(
137 "ExtensionBubble.ExtensionWipeoutCount", count); 141 "ExtensionBubble.ExtensionWipeoutCount", count);
138 } 142 }
139 143
140 void SuspiciousExtensionBubbleDelegate::LogAction( 144 void SuspiciousExtensionBubbleDelegate::LogAction(
141 ExtensionMessageBubbleController::BubbleAction action) { 145 ExtensionMessageBubbleController::BubbleAction action) {
142 UMA_HISTOGRAM_ENUMERATION( 146 UMA_HISTOGRAM_ENUMERATION(
143 "ExtensionBubble.WipeoutUserSelection", 147 "ExtensionBubble.WipeoutUserSelection",
(...skipping 26 matching lines...) Expand all
170 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && 174 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) &&
171 !GetExtensionList().empty(); 175 !GetExtensionList().empty();
172 } 176 }
173 177
174 void SuspiciousExtensionBubbleController::Show(ExtensionMessageBubble* bubble) { 178 void SuspiciousExtensionBubbleController::Show(ExtensionMessageBubble* bubble) {
175 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); 179 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile());
176 ExtensionMessageBubbleController::Show(bubble); 180 ExtensionMessageBubbleController::Show(bubble);
177 } 181 }
178 182
179 } // namespace extensions 183 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698