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

Side by Side Diff: chrome/browser/extensions/dev_mode_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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_message_bubble.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;
56 void LogExtensionCount(size_t count) override; 55 void LogExtensionCount(size_t count) override;
57 void LogAction( 56 void LogAction(
58 ExtensionMessageBubbleController::BubbleAction action) override; 57 ExtensionMessageBubbleController::BubbleAction action) override;
59 58
60 private: 59 private:
61 // Our extension service. Weak, not owned by us. 60 // Our extension service. Weak, not owned by us.
62 ExtensionService* service_; 61 ExtensionService* service_;
63 62
64 DISALLOW_COPY_AND_ASSIGN(DevModeBubbleDelegate); 63 DISALLOW_COPY_AND_ASSIGN(DevModeBubbleDelegate);
65 }; 64 };
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 120 }
122 121
123 base::string16 DevModeBubbleDelegate::GetDismissButtonLabel() const { 122 base::string16 DevModeBubbleDelegate::GetDismissButtonLabel() const {
124 return l10n_util::GetStringUTF16(IDS_CANCEL); 123 return l10n_util::GetStringUTF16(IDS_CANCEL);
125 } 124 }
126 125
127 bool DevModeBubbleDelegate::ShouldShowExtensionList() const { 126 bool DevModeBubbleDelegate::ShouldShowExtensionList() const {
128 return false; 127 return false;
129 } 128 }
130 129
131 bool DevModeBubbleDelegate::ShouldHighlightExtensions() const {
132 return true;
133 }
134
135 void DevModeBubbleDelegate::LogExtensionCount(size_t count) { 130 void DevModeBubbleDelegate::LogExtensionCount(size_t count) {
136 UMA_HISTOGRAM_COUNTS_100( 131 UMA_HISTOGRAM_COUNTS_100(
137 "ExtensionBubble.ExtensionsInDevModeCount", count); 132 "ExtensionBubble.ExtensionsInDevModeCount", count);
138 } 133 }
139 134
140 void DevModeBubbleDelegate::LogAction( 135 void DevModeBubbleDelegate::LogAction(
141 ExtensionMessageBubbleController::BubbleAction action) { 136 ExtensionMessageBubbleController::BubbleAction action) {
142 UMA_HISTOGRAM_ENUMERATION( 137 UMA_HISTOGRAM_ENUMERATION(
143 "ExtensionBubble.DevModeUserSelection", 138 "ExtensionBubble.DevModeUserSelection",
144 action, ExtensionMessageBubbleController::ACTION_BOUNDARY); 139 action, ExtensionMessageBubbleController::ACTION_BOUNDARY);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && 172 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) &&
178 !GetExtensionList().empty(); 173 !GetExtensionList().empty();
179 } 174 }
180 175
181 void DevModeBubbleController::Show(ExtensionMessageBubble* bubble) { 176 void DevModeBubbleController::Show(ExtensionMessageBubble* bubble) {
182 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); 177 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile());
183 ExtensionMessageBubbleController::Show(bubble); 178 ExtensionMessageBubbleController::Show(bubble);
184 } 179 }
185 180
186 } // namespace extensions 181 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_message_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698