| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/ntp_overridden_bubble_controller.h" | 5 #include "chrome/browser/extensions/ntp_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/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 virtual ~NtpOverriddenBubbleDelegate(); | 29 virtual ~NtpOverriddenBubbleDelegate(); |
| 30 | 30 |
| 31 // ExtensionMessageBubbleController::Delegate methods. | 31 // ExtensionMessageBubbleController::Delegate methods. |
| 32 virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE; | 32 virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE; |
| 33 virtual void AcknowledgeExtension( | 33 virtual void AcknowledgeExtension( |
| 34 const std::string& extension_id, | 34 const std::string& extension_id, |
| 35 extensions::ExtensionMessageBubbleController::BubbleAction | 35 extensions::ExtensionMessageBubbleController::BubbleAction |
| 36 user_action) OVERRIDE; | 36 user_action) OVERRIDE; |
| 37 virtual void PerformAction(const extensions::ExtensionIdList& list) OVERRIDE; | 37 virtual void PerformAction(const extensions::ExtensionIdList& list) OVERRIDE; |
| 38 virtual base::string16 GetTitle() const OVERRIDE; | 38 virtual base::string16 GetTitle() const OVERRIDE; |
| 39 virtual base::string16 GetMessageBody() const OVERRIDE; | 39 virtual base::string16 GetMessageBody( |
| 40 bool anchored_to_browser_action) const OVERRIDE; |
| 40 virtual base::string16 GetOverflowText( | 41 virtual base::string16 GetOverflowText( |
| 41 const base::string16& overflow_count) const OVERRIDE; | 42 const base::string16& overflow_count) const OVERRIDE; |
| 42 virtual base::string16 GetLearnMoreLabel() const OVERRIDE; | 43 virtual base::string16 GetLearnMoreLabel() const OVERRIDE; |
| 43 virtual GURL GetLearnMoreUrl() const OVERRIDE; | 44 virtual GURL GetLearnMoreUrl() const OVERRIDE; |
| 44 virtual base::string16 GetActionButtonLabel() const OVERRIDE; | 45 virtual base::string16 GetActionButtonLabel() const OVERRIDE; |
| 45 virtual base::string16 GetDismissButtonLabel() const OVERRIDE; | 46 virtual base::string16 GetDismissButtonLabel() const OVERRIDE; |
| 46 virtual bool ShouldShowExtensionList() const OVERRIDE; | 47 virtual bool ShouldShowExtensionList() const OVERRIDE; |
| 47 virtual void RestrictToSingleExtension( | 48 virtual void RestrictToSingleExtension( |
| 48 const std::string& extension_id) OVERRIDE; | 49 const std::string& extension_id) OVERRIDE; |
| 49 virtual void LogExtensionCount(size_t count) OVERRIDE; | 50 virtual void LogExtensionCount(size_t count) OVERRIDE; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 service_->DisableExtension(list[i], | 107 service_->DisableExtension(list[i], |
| 107 extensions::Extension::DISABLE_USER_ACTION); | 108 extensions::Extension::DISABLE_USER_ACTION); |
| 108 } | 109 } |
| 109 } | 110 } |
| 110 | 111 |
| 111 base::string16 NtpOverriddenBubbleDelegate::GetTitle() const { | 112 base::string16 NtpOverriddenBubbleDelegate::GetTitle() const { |
| 112 return l10n_util::GetStringUTF16( | 113 return l10n_util::GetStringUTF16( |
| 113 IDS_EXTENSIONS_NTP_CONTROLLED_TITLE_HOME_PAGE_BUBBLE); | 114 IDS_EXTENSIONS_NTP_CONTROLLED_TITLE_HOME_PAGE_BUBBLE); |
| 114 } | 115 } |
| 115 | 116 |
| 116 base::string16 NtpOverriddenBubbleDelegate::GetMessageBody() const { | 117 base::string16 NtpOverriddenBubbleDelegate::GetMessageBody( |
| 118 bool anchored_to_browser_action) const { |
| 117 base::string16 body = | 119 base::string16 body = |
| 118 l10n_util::GetStringUTF16(IDS_EXTENSIONS_NTP_CONTROLLED_FIRST_LINE); | 120 l10n_util::GetStringUTF16(IDS_EXTENSIONS_NTP_CONTROLLED_FIRST_LINE); |
| 119 body += l10n_util::GetStringUTF16( | 121 body += l10n_util::GetStringUTF16( |
| 120 IDS_EXTENSIONS_SETTINGS_API_THIRD_LINE_CONFIRMATION); | 122 IDS_EXTENSIONS_SETTINGS_API_THIRD_LINE_CONFIRMATION); |
| 121 return body; | 123 return body; |
| 122 } | 124 } |
| 123 | 125 |
| 124 base::string16 NtpOverriddenBubbleDelegate::GetOverflowText( | 126 base::string16 NtpOverriddenBubbleDelegate::GetOverflowText( |
| 125 const base::string16& overflow_count) const { | 127 const base::string16& overflow_count) const { |
| 126 // Does not have more than one extension in the list at a time. | 128 // Does not have more than one extension in the list at a time. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 190 |
| 189 delegate()->RestrictToSingleExtension(extension_id); | 191 delegate()->RestrictToSingleExtension(extension_id); |
| 190 return true; | 192 return true; |
| 191 } | 193 } |
| 192 | 194 |
| 193 bool NtpOverriddenBubbleController::CloseOnDeactivate() { | 195 bool NtpOverriddenBubbleController::CloseOnDeactivate() { |
| 194 return true; | 196 return true; |
| 195 } | 197 } |
| 196 | 198 |
| 197 } // namespace extensions | 199 } // namespace extensions |
| OLD | NEW |