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

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

Issue 1081113002: Revert of [Extensions] Make extension message bubble factory platform-abstract (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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;
57 void LogExtensionCount(size_t count) override; 56 void LogExtensionCount(size_t count) override;
58 void LogAction( 57 void LogAction(
59 ExtensionMessageBubbleController::BubbleAction action) override; 58 ExtensionMessageBubbleController::BubbleAction action) override;
60 59
61 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate); 60 DISALLOW_COPY_AND_ASSIGN(SuspiciousExtensionBubbleDelegate);
62 }; 61 };
63 62
64 SuspiciousExtensionBubbleDelegate::SuspiciousExtensionBubbleDelegate( 63 SuspiciousExtensionBubbleDelegate::SuspiciousExtensionBubbleDelegate(
65 Profile* profile) 64 Profile* profile)
66 : extensions::ExtensionMessageBubbleController::Delegate(profile) { 65 : extensions::ExtensionMessageBubbleController::Delegate(profile) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 base::string16 119 base::string16
121 SuspiciousExtensionBubbleDelegate::GetActionButtonLabel() const { 120 SuspiciousExtensionBubbleDelegate::GetActionButtonLabel() const {
122 return base::string16(); 121 return base::string16();
123 } 122 }
124 123
125 base::string16 124 base::string16
126 SuspiciousExtensionBubbleDelegate::GetDismissButtonLabel() const { 125 SuspiciousExtensionBubbleDelegate::GetDismissButtonLabel() const {
127 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNSUPPORTED_DISABLED_BUTTON); 126 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNSUPPORTED_DISABLED_BUTTON);
128 } 127 }
129 128
130 bool SuspiciousExtensionBubbleDelegate::ShouldShowExtensionList() const { 129 bool
130 SuspiciousExtensionBubbleDelegate::ShouldShowExtensionList() const {
131 return true; 131 return true;
132 } 132 }
133 133
134 bool SuspiciousExtensionBubbleDelegate::ShouldHighlightExtensions() const {
135 return false;
136 }
137
138 void SuspiciousExtensionBubbleDelegate::LogExtensionCount( 134 void SuspiciousExtensionBubbleDelegate::LogExtensionCount(
139 size_t count) { 135 size_t count) {
140 UMA_HISTOGRAM_COUNTS_100( 136 UMA_HISTOGRAM_COUNTS_100(
141 "ExtensionBubble.ExtensionWipeoutCount", count); 137 "ExtensionBubble.ExtensionWipeoutCount", count);
142 } 138 }
143 139
144 void SuspiciousExtensionBubbleDelegate::LogAction( 140 void SuspiciousExtensionBubbleDelegate::LogAction(
145 ExtensionMessageBubbleController::BubbleAction action) { 141 ExtensionMessageBubbleController::BubbleAction action) {
146 UMA_HISTOGRAM_ENUMERATION( 142 UMA_HISTOGRAM_ENUMERATION(
147 "ExtensionBubble.WipeoutUserSelection", 143 "ExtensionBubble.WipeoutUserSelection",
(...skipping 26 matching lines...) Expand all
174 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && 170 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) &&
175 !GetExtensionList().empty(); 171 !GetExtensionList().empty();
176 } 172 }
177 173
178 void SuspiciousExtensionBubbleController::Show(ExtensionMessageBubble* bubble) { 174 void SuspiciousExtensionBubbleController::Show(ExtensionMessageBubble* bubble) {
179 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); 175 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile());
180 ExtensionMessageBubbleController::Show(bubble); 176 ExtensionMessageBubbleController::Show(bubble);
181 } 177 }
182 178
183 } // namespace extensions 179 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698