| 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( | 39 virtual base::string16 GetMessageBody() const OVERRIDE; |
| 40 bool anchored_to_browser_action) const OVERRIDE; | |
| 41 virtual base::string16 GetOverflowText( | 40 virtual base::string16 GetOverflowText( |
| 42 const base::string16& overflow_count) const OVERRIDE; | 41 const base::string16& overflow_count) const OVERRIDE; |
| 43 virtual base::string16 GetLearnMoreLabel() const OVERRIDE; | 42 virtual base::string16 GetLearnMoreLabel() const OVERRIDE; |
| 44 virtual GURL GetLearnMoreUrl() const OVERRIDE; | 43 virtual GURL GetLearnMoreUrl() const OVERRIDE; |
| 45 virtual base::string16 GetActionButtonLabel() const OVERRIDE; | 44 virtual base::string16 GetActionButtonLabel() const OVERRIDE; |
| 46 virtual base::string16 GetDismissButtonLabel() const OVERRIDE; | 45 virtual base::string16 GetDismissButtonLabel() const OVERRIDE; |
| 47 virtual bool ShouldShowExtensionList() const OVERRIDE; | 46 virtual bool ShouldShowExtensionList() const OVERRIDE; |
| 48 virtual void RestrictToSingleExtension( | 47 virtual void RestrictToSingleExtension( |
| 49 const std::string& extension_id) OVERRIDE; | 48 const std::string& extension_id) OVERRIDE; |
| 50 virtual void LogExtensionCount(size_t count) OVERRIDE; | 49 virtual void LogExtensionCount(size_t count) OVERRIDE; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 service_->DisableExtension(list[i], | 106 service_->DisableExtension(list[i], |
| 108 extensions::Extension::DISABLE_USER_ACTION); | 107 extensions::Extension::DISABLE_USER_ACTION); |
| 109 } | 108 } |
| 110 } | 109 } |
| 111 | 110 |
| 112 base::string16 NtpOverriddenBubbleDelegate::GetTitle() const { | 111 base::string16 NtpOverriddenBubbleDelegate::GetTitle() const { |
| 113 return l10n_util::GetStringUTF16( | 112 return l10n_util::GetStringUTF16( |
| 114 IDS_EXTENSIONS_NTP_CONTROLLED_TITLE_HOME_PAGE_BUBBLE); | 113 IDS_EXTENSIONS_NTP_CONTROLLED_TITLE_HOME_PAGE_BUBBLE); |
| 115 } | 114 } |
| 116 | 115 |
| 117 base::string16 NtpOverriddenBubbleDelegate::GetMessageBody( | 116 base::string16 NtpOverriddenBubbleDelegate::GetMessageBody() const { |
| 118 bool anchored_to_browser_action) const { | |
| 119 base::string16 body = | 117 base::string16 body = |
| 120 l10n_util::GetStringUTF16(IDS_EXTENSIONS_NTP_CONTROLLED_FIRST_LINE); | 118 l10n_util::GetStringUTF16(IDS_EXTENSIONS_NTP_CONTROLLED_FIRST_LINE); |
| 121 body += l10n_util::GetStringUTF16( | 119 body += l10n_util::GetStringUTF16( |
| 122 IDS_EXTENSIONS_SETTINGS_API_THIRD_LINE_CONFIRMATION); | 120 IDS_EXTENSIONS_SETTINGS_API_THIRD_LINE_CONFIRMATION); |
| 123 return body; | 121 return body; |
| 124 } | 122 } |
| 125 | 123 |
| 126 base::string16 NtpOverriddenBubbleDelegate::GetOverflowText( | 124 base::string16 NtpOverriddenBubbleDelegate::GetOverflowText( |
| 127 const base::string16& overflow_count) const { | 125 const base::string16& overflow_count) const { |
| 128 // Does not have more than one extension in the list at a time. | 126 // 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... |
| 190 | 188 |
| 191 delegate()->RestrictToSingleExtension(extension_id); | 189 delegate()->RestrictToSingleExtension(extension_id); |
| 192 return true; | 190 return true; |
| 193 } | 191 } |
| 194 | 192 |
| 195 bool NtpOverriddenBubbleController::CloseOnDeactivate() { | 193 bool NtpOverriddenBubbleController::CloseOnDeactivate() { |
| 196 return true; | 194 return true; |
| 197 } | 195 } |
| 198 | 196 |
| 199 } // namespace extensions | 197 } // namespace extensions |
| OLD | NEW |