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

Side by Side Diff: chrome/browser/extensions/dev_mode_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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_action_test_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dev_mode_bubble_controller.h" 5 #include "chrome/browser/extensions/dev_mode_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 "chrome/browser/extensions/extension_action_manager.h" 9 #include "chrome/browser/extensions/extension_action_manager.h"
10 #include "chrome/browser/extensions/extension_message_bubble.h" 10 #include "chrome/browser/extensions/extension_message_bubble.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 void PerformAction(const ExtensionIdList& list) override; 45 void PerformAction(const ExtensionIdList& list) override;
46 void OnClose() override; 46 void OnClose() override;
47 base::string16 GetTitle() const override; 47 base::string16 GetTitle() const override;
48 base::string16 GetMessageBody(bool anchored_to_browser_action) const override; 48 base::string16 GetMessageBody(bool anchored_to_browser_action) const override;
49 base::string16 GetOverflowText( 49 base::string16 GetOverflowText(
50 const base::string16& overflow_count) const override; 50 const base::string16& overflow_count) const override;
51 GURL GetLearnMoreUrl() const override; 51 GURL GetLearnMoreUrl() const override;
52 base::string16 GetActionButtonLabel() const override; 52 base::string16 GetActionButtonLabel() const override;
53 base::string16 GetDismissButtonLabel() const override; 53 base::string16 GetDismissButtonLabel() const override;
54 bool ShouldShowExtensionList() const override; 54 bool ShouldShowExtensionList() const override;
55 bool ShouldHighlightExtensions() const override;
55 void LogExtensionCount(size_t count) override; 56 void LogExtensionCount(size_t count) override;
56 void LogAction( 57 void LogAction(
57 ExtensionMessageBubbleController::BubbleAction action) override; 58 ExtensionMessageBubbleController::BubbleAction action) override;
58 59
59 private: 60 private:
60 // Our extension service. Weak, not owned by us. 61 // Our extension service. Weak, not owned by us.
61 ExtensionService* service_; 62 ExtensionService* service_;
62 63
63 DISALLOW_COPY_AND_ASSIGN(DevModeBubbleDelegate); 64 DISALLOW_COPY_AND_ASSIGN(DevModeBubbleDelegate);
64 }; 65 };
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 121 }
121 122
122 base::string16 DevModeBubbleDelegate::GetDismissButtonLabel() const { 123 base::string16 DevModeBubbleDelegate::GetDismissButtonLabel() const {
123 return l10n_util::GetStringUTF16(IDS_CANCEL); 124 return l10n_util::GetStringUTF16(IDS_CANCEL);
124 } 125 }
125 126
126 bool DevModeBubbleDelegate::ShouldShowExtensionList() const { 127 bool DevModeBubbleDelegate::ShouldShowExtensionList() const {
127 return false; 128 return false;
128 } 129 }
129 130
131 bool DevModeBubbleDelegate::ShouldHighlightExtensions() const {
132 return true;
133 }
134
130 void DevModeBubbleDelegate::LogExtensionCount(size_t count) { 135 void DevModeBubbleDelegate::LogExtensionCount(size_t count) {
131 UMA_HISTOGRAM_COUNTS_100( 136 UMA_HISTOGRAM_COUNTS_100(
132 "ExtensionBubble.ExtensionsInDevModeCount", count); 137 "ExtensionBubble.ExtensionsInDevModeCount", count);
133 } 138 }
134 139
135 void DevModeBubbleDelegate::LogAction( 140 void DevModeBubbleDelegate::LogAction(
136 ExtensionMessageBubbleController::BubbleAction action) { 141 ExtensionMessageBubbleController::BubbleAction action) {
137 UMA_HISTOGRAM_ENUMERATION( 142 UMA_HISTOGRAM_ENUMERATION(
138 "ExtensionBubble.DevModeUserSelection", 143 "ExtensionBubble.DevModeUserSelection",
139 action, ExtensionMessageBubbleController::ACTION_BOUNDARY); 144 action, ExtensionMessageBubbleController::ACTION_BOUNDARY);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && 177 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) &&
173 !GetExtensionList().empty(); 178 !GetExtensionList().empty();
174 } 179 }
175 180
176 void DevModeBubbleController::Show(ExtensionMessageBubble* bubble) { 181 void DevModeBubbleController::Show(ExtensionMessageBubble* bubble) {
177 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); 182 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile());
178 ExtensionMessageBubbleController::Show(bubble); 183 ExtensionMessageBubbleController::Show(bubble);
179 } 184 }
180 185
181 } // namespace extensions 186 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_action_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698