| 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 "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/settings_api_helpers.h" | 10 #include "chrome/browser/extensions/settings_api_helpers.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/common/url_constants.h" | 12 #include "chrome/common/url_constants.h" |
| 12 #include "chrome/grit/generated_resources.h" | 13 #include "chrome/grit/generated_resources.h" |
| 13 #include "extensions/browser/extension_prefs.h" | 14 #include "extensions/browser/extension_prefs.h" |
| 14 #include "extensions/browser/extension_registry.h" | 15 #include "extensions/browser/extension_registry.h" |
| 15 #include "extensions/browser/extension_system.h" | 16 #include "extensions/browser/extension_system.h" |
| 16 #include "grit/components_strings.h" | 17 #include "grit/components_strings.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) const { |
| 125 if (anchored_to_browser_action) { | 126 if (anchored_to_browser_action) { |
| 126 return l10n_util::GetStringUTF16( | 127 return l10n_util::GetStringUTF16( |
| 127 IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE_EXTENSION_SPECIFIC); | 128 IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE_EXTENSION_SPECIFIC); |
| 128 } else { | 129 } else { |
| 129 return l10n_util::GetStringUTF16( | 130 const Extension* extension = |
| 130 IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE); | 131 ExtensionRegistry::Get(profile())->GetExtensionById( |
| 132 extension_id_, ExtensionRegistry::EVERYTHING); |
| 133 // If the bubble is about to show, the extension should certainly exist. |
| 134 CHECK(extension); |
| 135 return l10n_util::GetStringFUTF16( |
| 136 IDS_EXTENSIONS_PROXY_CONTROLLED_FIRST_LINE, |
| 137 base::UTF8ToUTF16(extension->name())); |
| 131 } | 138 } |
| 132 } | 139 } |
| 133 | 140 |
| 134 base::string16 ProxyOverriddenBubbleDelegate::GetOverflowText( | 141 base::string16 ProxyOverriddenBubbleDelegate::GetOverflowText( |
| 135 const base::string16& overflow_count) const { | 142 const base::string16& overflow_count) const { |
| 136 // Does not have more than one extension in the list at a time. | 143 // Does not have more than one extension in the list at a time. |
| 137 NOTREACHED(); | 144 NOTREACHED(); |
| 138 return base::string16(); | 145 return base::string16(); |
| 139 } | 146 } |
| 140 | 147 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 204 |
| 198 delegate()->RestrictToSingleExtension(extension_id); | 205 delegate()->RestrictToSingleExtension(extension_id); |
| 199 return true; | 206 return true; |
| 200 } | 207 } |
| 201 | 208 |
| 202 bool ProxyOverriddenBubbleController::CloseOnDeactivate() { | 209 bool ProxyOverriddenBubbleController::CloseOnDeactivate() { |
| 203 return false; | 210 return false; |
| 204 } | 211 } |
| 205 | 212 |
| 206 } // namespace extensions | 213 } // namespace extensions |
| OLD | NEW |