| 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 29 matching lines...) Expand all Loading... |
| 40 override; | 40 override; |
| 41 void PerformAction(const extensions::ExtensionIdList& list) override; | 41 void PerformAction(const extensions::ExtensionIdList& list) override; |
| 42 base::string16 GetTitle() const override; | 42 base::string16 GetTitle() const override; |
| 43 base::string16 GetMessageBody(bool anchored_to_browser_action) const override; | 43 base::string16 GetMessageBody(bool anchored_to_browser_action) const override; |
| 44 base::string16 GetOverflowText( | 44 base::string16 GetOverflowText( |
| 45 const base::string16& overflow_count) const override; | 45 const base::string16& overflow_count) const override; |
| 46 GURL GetLearnMoreUrl() const override; | 46 GURL GetLearnMoreUrl() const override; |
| 47 base::string16 GetActionButtonLabel() const override; | 47 base::string16 GetActionButtonLabel() const override; |
| 48 base::string16 GetDismissButtonLabel() const override; | 48 base::string16 GetDismissButtonLabel() const override; |
| 49 bool ShouldShowExtensionList() const override; | 49 bool ShouldShowExtensionList() const override; |
| 50 bool ShouldHighlightExtensions() const override; |
| 50 void RestrictToSingleExtension(const std::string& extension_id) override; | 51 void RestrictToSingleExtension(const std::string& extension_id) override; |
| 51 void LogExtensionCount(size_t count) override; | 52 void LogExtensionCount(size_t count) override; |
| 52 void LogAction(extensions::ExtensionMessageBubbleController::BubbleAction | 53 void LogAction(extensions::ExtensionMessageBubbleController::BubbleAction |
| 53 action) override; | 54 action) override; |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 // Our extension service. Weak, not owned by us. | 57 // Our extension service. Weak, not owned by us. |
| 57 ExtensionService* service_; | 58 ExtensionService* service_; |
| 58 | 59 |
| 59 // The ID of the extension we are showing the bubble for. | 60 // The ID of the extension we are showing the bubble for. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 136 } |
| 136 | 137 |
| 137 base::string16 NtpOverriddenBubbleDelegate::GetDismissButtonLabel() const { | 138 base::string16 NtpOverriddenBubbleDelegate::GetDismissButtonLabel() const { |
| 138 return l10n_util::GetStringUTF16(IDS_EXTENSION_CONTROLLED_KEEP_CHANGES); | 139 return l10n_util::GetStringUTF16(IDS_EXTENSION_CONTROLLED_KEEP_CHANGES); |
| 139 } | 140 } |
| 140 | 141 |
| 141 bool NtpOverriddenBubbleDelegate::ShouldShowExtensionList() const { | 142 bool NtpOverriddenBubbleDelegate::ShouldShowExtensionList() const { |
| 142 return false; | 143 return false; |
| 143 } | 144 } |
| 144 | 145 |
| 146 bool NtpOverriddenBubbleDelegate::ShouldHighlightExtensions() const { |
| 147 return false; |
| 148 } |
| 149 |
| 145 void NtpOverriddenBubbleDelegate::RestrictToSingleExtension( | 150 void NtpOverriddenBubbleDelegate::RestrictToSingleExtension( |
| 146 const std::string& extension_id) { | 151 const std::string& extension_id) { |
| 147 extension_id_ = extension_id; | 152 extension_id_ = extension_id; |
| 148 } | 153 } |
| 149 | 154 |
| 150 void NtpOverriddenBubbleDelegate::LogExtensionCount(size_t count) { | 155 void NtpOverriddenBubbleDelegate::LogExtensionCount(size_t count) { |
| 151 } | 156 } |
| 152 | 157 |
| 153 void NtpOverriddenBubbleDelegate::LogAction( | 158 void NtpOverriddenBubbleDelegate::LogAction( |
| 154 ExtensionMessageBubbleController::BubbleAction action) { | 159 ExtensionMessageBubbleController::BubbleAction action) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 182 | 187 |
| 183 delegate()->RestrictToSingleExtension(extension_id); | 188 delegate()->RestrictToSingleExtension(extension_id); |
| 184 return true; | 189 return true; |
| 185 } | 190 } |
| 186 | 191 |
| 187 bool NtpOverriddenBubbleController::CloseOnDeactivate() { | 192 bool NtpOverriddenBubbleController::CloseOnDeactivate() { |
| 188 return true; | 193 return true; |
| 189 } | 194 } |
| 190 | 195 |
| 191 } // namespace extensions | 196 } // namespace extensions |
| OLD | NEW |