| 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 "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/settings_api_helpers.h" | 10 #include "chrome/browser/extensions/settings_api_helpers.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 ProxyOverriddenBubbleDelegate(ExtensionService* service, Profile* profile); | 37 ProxyOverriddenBubbleDelegate(ExtensionService* service, Profile* profile); |
| 38 ~ProxyOverriddenBubbleDelegate() override; | 38 ~ProxyOverriddenBubbleDelegate() override; |
| 39 | 39 |
| 40 // ExtensionMessageBubbleController::Delegate methods. | 40 // ExtensionMessageBubbleController::Delegate methods. |
| 41 bool ShouldIncludeExtension(const std::string& extension_id) override; | 41 bool ShouldIncludeExtension(const std::string& extension_id) override; |
| 42 void AcknowledgeExtension( | 42 void AcknowledgeExtension( |
| 43 const std::string& extension_id, | 43 const std::string& extension_id, |
| 44 ExtensionMessageBubbleController::BubbleAction user_action) override; | 44 ExtensionMessageBubbleController::BubbleAction user_action) override; |
| 45 void PerformAction(const ExtensionIdList& list) override; | 45 void PerformAction(const ExtensionIdList& list) 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, |
| 48 int extension_count) const override; |
| 48 base::string16 GetOverflowText( | 49 base::string16 GetOverflowText( |
| 49 const base::string16& overflow_count) const override; | 50 const base::string16& overflow_count) const override; |
| 50 GURL GetLearnMoreUrl() const override; | 51 GURL GetLearnMoreUrl() const override; |
| 51 base::string16 GetActionButtonLabel() const override; | 52 base::string16 GetActionButtonLabel() const override; |
| 52 base::string16 GetDismissButtonLabel() const override; | 53 base::string16 GetDismissButtonLabel() const override; |
| 53 bool ShouldShowExtensionList() const override; | 54 bool ShouldShowExtensionList() const override; |
| 54 bool ShouldHighlightExtensions() const override; | 55 bool ShouldHighlightExtensions() const override; |
| 55 void RestrictToSingleExtension(const std::string& extension_id) override; | 56 void RestrictToSingleExtension(const std::string& extension_id) override; |
| 56 void LogExtensionCount(size_t count) override; | 57 void LogExtensionCount(size_t count) override; |
| 57 void LogAction( | 58 void LogAction( |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 for (size_t i = 0; i < list.size(); ++i) | 116 for (size_t i = 0; i < list.size(); ++i) |
| 116 service_->DisableExtension(list[i], Extension::DISABLE_USER_ACTION); | 117 service_->DisableExtension(list[i], Extension::DISABLE_USER_ACTION); |
| 117 } | 118 } |
| 118 | 119 |
| 119 base::string16 ProxyOverriddenBubbleDelegate::GetTitle() const { | 120 base::string16 ProxyOverriddenBubbleDelegate::GetTitle() const { |
| 120 return l10n_util::GetStringUTF16( | 121 return l10n_util::GetStringUTF16( |
| 121 IDS_EXTENSIONS_PROXY_CONTROLLED_TITLE_HOME_PAGE_BUBBLE); | 122 IDS_EXTENSIONS_PROXY_CONTROLLED_TITLE_HOME_PAGE_BUBBLE); |
| 122 } | 123 } |
| 123 | 124 |
| 124 base::string16 ProxyOverriddenBubbleDelegate::GetMessageBody( | 125 base::string16 ProxyOverriddenBubbleDelegate::GetMessageBody( |
| 125 bool anchored_to_browser_action) const { | 126 bool anchored_to_browser_action, |
| 127 int extension_count) const { |
| 126 if (anchored_to_browser_action) { | 128 if (anchored_to_browser_action) { |
| 127 return l10n_util::GetStringUTF16( | 129 return l10n_util::GetStringUTF16( |
| 128 IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE_EXTENSION_SPECIFIC); | 130 IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE_EXTENSION_SPECIFIC); |
| 129 } else { | 131 } else { |
| 130 const Extension* extension = | 132 const Extension* extension = |
| 131 ExtensionRegistry::Get(profile())->GetExtensionById( | 133 ExtensionRegistry::Get(profile())->GetExtensionById( |
| 132 extension_id_, ExtensionRegistry::EVERYTHING); | 134 extension_id_, ExtensionRegistry::EVERYTHING); |
| 133 // If the bubble is about to show, the extension should certainly exist. | 135 // If the bubble is about to show, the extension should certainly exist. |
| 134 CHECK(extension); | 136 CHECK(extension); |
| 135 return l10n_util::GetStringFUTF16( | 137 return l10n_util::GetStringFUTF16( |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 206 |
| 205 delegate()->RestrictToSingleExtension(extension_id); | 207 delegate()->RestrictToSingleExtension(extension_id); |
| 206 return true; | 208 return true; |
| 207 } | 209 } |
| 208 | 210 |
| 209 bool ProxyOverriddenBubbleController::CloseOnDeactivate() { | 211 bool ProxyOverriddenBubbleController::CloseOnDeactivate() { |
| 210 return false; | 212 return false; |
| 211 } | 213 } |
| 212 | 214 |
| 213 } // namespace extensions | 215 } // namespace extensions |
| OLD | NEW |