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/settings_api_helpers.h" | 9 #include "chrome/browser/extensions/settings_api_helpers.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 ProxyOverriddenBubbleDelegate(ExtensionService* service, Profile* profile); | 36 ProxyOverriddenBubbleDelegate(ExtensionService* service, Profile* profile); |
37 ~ProxyOverriddenBubbleDelegate() override; | 37 ~ProxyOverriddenBubbleDelegate() override; |
38 | 38 |
39 // ExtensionMessageBubbleController::Delegate methods. | 39 // ExtensionMessageBubbleController::Delegate methods. |
40 bool ShouldIncludeExtension(const std::string& extension_id) override; | 40 bool ShouldIncludeExtension(const std::string& extension_id) override; |
41 void AcknowledgeExtension( | 41 void AcknowledgeExtension( |
42 const std::string& extension_id, | 42 const std::string& extension_id, |
43 ExtensionMessageBubbleController::BubbleAction user_action) override; | 43 ExtensionMessageBubbleController::BubbleAction user_action) override; |
44 void PerformAction(const ExtensionIdList& list) override; | 44 void PerformAction(const ExtensionIdList& list) override; |
45 base::string16 GetTitle() const override; | 45 base::string16 GetTitle() const override; |
46 base::string16 GetMessageBody(bool anchored_to_browser_action) const override; | 46 base::string16 GetMessageBody(bool anchored_to_browser_action, |
| 47 bool for_single_extension) const override; |
47 base::string16 GetOverflowText( | 48 base::string16 GetOverflowText( |
48 const base::string16& overflow_count) const override; | 49 const base::string16& overflow_count) const override; |
49 GURL GetLearnMoreUrl() const override; | 50 GURL GetLearnMoreUrl() const override; |
50 base::string16 GetActionButtonLabel() const override; | 51 base::string16 GetActionButtonLabel() const override; |
51 base::string16 GetDismissButtonLabel() const override; | 52 base::string16 GetDismissButtonLabel() const override; |
52 bool ShouldShowExtensionList() const override; | 53 bool ShouldShowExtensionList() const override; |
53 bool ShouldHighlightExtensions() 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( |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 for (size_t i = 0; i < list.size(); ++i) | 115 for (size_t i = 0; i < list.size(); ++i) |
115 service_->DisableExtension(list[i], Extension::DISABLE_USER_ACTION); | 116 service_->DisableExtension(list[i], Extension::DISABLE_USER_ACTION); |
116 } | 117 } |
117 | 118 |
118 base::string16 ProxyOverriddenBubbleDelegate::GetTitle() const { | 119 base::string16 ProxyOverriddenBubbleDelegate::GetTitle() const { |
119 return l10n_util::GetStringUTF16( | 120 return l10n_util::GetStringUTF16( |
120 IDS_EXTENSIONS_PROXY_CONTROLLED_TITLE_HOME_PAGE_BUBBLE); | 121 IDS_EXTENSIONS_PROXY_CONTROLLED_TITLE_HOME_PAGE_BUBBLE); |
121 } | 122 } |
122 | 123 |
123 base::string16 ProxyOverriddenBubbleDelegate::GetMessageBody( | 124 base::string16 ProxyOverriddenBubbleDelegate::GetMessageBody( |
124 bool anchored_to_browser_action) const { | 125 bool anchored_to_browser_action, |
| 126 bool for_single_extension) const { |
125 if (anchored_to_browser_action) { | 127 if (anchored_to_browser_action) { |
126 return l10n_util::GetStringUTF16( | 128 return l10n_util::GetStringUTF16( |
127 IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE_EXTENSION_SPECIFIC); | 129 IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE_EXTENSION_SPECIFIC); |
128 } else { | 130 } else { |
129 return l10n_util::GetStringUTF16( | 131 return l10n_util::GetStringUTF16( |
130 IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE); | 132 IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE); |
131 } | 133 } |
132 } | 134 } |
133 | 135 |
134 base::string16 ProxyOverriddenBubbleDelegate::GetOverflowText( | 136 base::string16 ProxyOverriddenBubbleDelegate::GetOverflowText( |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 199 |
198 delegate()->RestrictToSingleExtension(extension_id); | 200 delegate()->RestrictToSingleExtension(extension_id); |
199 return true; | 201 return true; |
200 } | 202 } |
201 | 203 |
202 bool ProxyOverriddenBubbleController::CloseOnDeactivate() { | 204 bool ProxyOverriddenBubbleController::CloseOnDeactivate() { |
203 return false; | 205 return false; |
204 } | 206 } |
205 | 207 |
206 } // namespace extensions | 208 } // namespace extensions |
OLD | NEW |