OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/proxy_overridden_bubble_controller.h" | 5 #include "chrome/browser/extensions/proxy_overridden_bubble_controller.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_toolbar_model.h" | 9 #include "chrome/browser/extensions/extension_toolbar_model.h" |
10 #include "chrome/browser/extensions/settings_api_helpers.h" | 10 #include "chrome/browser/extensions/settings_api_helpers.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void PerformAction(const ExtensionIdList& list) override; | 44 void PerformAction(const ExtensionIdList& list) override; |
45 void OnClose() override; | 45 void OnClose() override; |
46 base::string16 GetTitle() const override; | 46 base::string16 GetTitle() const override; |
47 base::string16 GetMessageBody(bool anchored_to_browser_action) const override; | 47 base::string16 GetMessageBody(bool anchored_to_browser_action) const override; |
48 base::string16 GetOverflowText( | 48 base::string16 GetOverflowText( |
49 const base::string16& overflow_count) const override; | 49 const base::string16& overflow_count) const override; |
50 GURL GetLearnMoreUrl() const override; | 50 GURL GetLearnMoreUrl() const override; |
51 base::string16 GetActionButtonLabel() const override; | 51 base::string16 GetActionButtonLabel() const override; |
52 base::string16 GetDismissButtonLabel() const override; | 52 base::string16 GetDismissButtonLabel() const override; |
53 bool ShouldShowExtensionList() const override; | 53 bool ShouldShowExtensionList() const override; |
| 54 bool ShouldHighlightExtensions() const override; |
54 void RestrictToSingleExtension(const std::string& extension_id) override; | 55 void RestrictToSingleExtension(const std::string& extension_id) 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 // The ID of the extension we are showing the bubble for. | 64 // The ID of the extension we are showing the bubble for. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 155 } |
155 | 156 |
156 base::string16 ProxyOverriddenBubbleDelegate::GetDismissButtonLabel() const { | 157 base::string16 ProxyOverriddenBubbleDelegate::GetDismissButtonLabel() const { |
157 return l10n_util::GetStringUTF16(IDS_EXTENSION_CONTROLLED_KEEP_CHANGES); | 158 return l10n_util::GetStringUTF16(IDS_EXTENSION_CONTROLLED_KEEP_CHANGES); |
158 } | 159 } |
159 | 160 |
160 bool ProxyOverriddenBubbleDelegate::ShouldShowExtensionList() const { | 161 bool ProxyOverriddenBubbleDelegate::ShouldShowExtensionList() const { |
161 return false; | 162 return false; |
162 } | 163 } |
163 | 164 |
| 165 bool ProxyOverriddenBubbleDelegate::ShouldHighlightExtensions() const { |
| 166 return true; |
| 167 } |
| 168 |
164 void ProxyOverriddenBubbleDelegate::RestrictToSingleExtension( | 169 void ProxyOverriddenBubbleDelegate::RestrictToSingleExtension( |
165 const std::string& extension_id) { | 170 const std::string& extension_id) { |
166 extension_id_ = extension_id; | 171 extension_id_ = extension_id; |
167 } | 172 } |
168 | 173 |
169 void ProxyOverriddenBubbleDelegate::LogExtensionCount(size_t count) { | 174 void ProxyOverriddenBubbleDelegate::LogExtensionCount(size_t count) { |
170 UMA_HISTOGRAM_COUNTS_100("ProxyOverriddenBubble.ExtensionCount", count); | 175 UMA_HISTOGRAM_COUNTS_100("ProxyOverriddenBubble.ExtensionCount", count); |
171 } | 176 } |
172 | 177 |
173 void ProxyOverriddenBubbleDelegate::LogAction( | 178 void ProxyOverriddenBubbleDelegate::LogAction( |
(...skipping 26 matching lines...) Expand all Loading... |
200 | 205 |
201 delegate()->RestrictToSingleExtension(extension_id); | 206 delegate()->RestrictToSingleExtension(extension_id); |
202 return true; | 207 return true; |
203 } | 208 } |
204 | 209 |
205 bool ProxyOverriddenBubbleController::CloseOnDeactivate() { | 210 bool ProxyOverriddenBubbleController::CloseOnDeactivate() { |
206 return false; | 211 return false; |
207 } | 212 } |
208 | 213 |
209 } // namespace extensions | 214 } // namespace extensions |
OLD | NEW |