| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/extension_message_bubble_controller.h" | 5 #include "chrome/browser/extensions/extension_message_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 int old_size = extension_list.size(); | 134 int old_size = extension_list.size(); |
| 135 extension_list.erase(extension_list.begin() + kMaxExtensionsToShow, | 135 extension_list.erase(extension_list.begin() + kMaxExtensionsToShow, |
| 136 extension_list.end()); | 136 extension_list.end()); |
| 137 extension_list.push_back(delegate_->GetOverflowText(base::IntToString16( | 137 extension_list.push_back(delegate_->GetOverflowText(base::IntToString16( |
| 138 old_size - kMaxExtensionsToShow))); | 138 old_size - kMaxExtensionsToShow))); |
| 139 } | 139 } |
| 140 const base::char16 bullet_point = 0x2022; | 140 const base::char16 bullet_point = 0x2022; |
| 141 base::string16 prefix = bullet_point + base::ASCIIToUTF16(" "); | 141 base::string16 prefix = bullet_point + base::ASCIIToUTF16(" "); |
| 142 for (base::string16& str : extension_list) | 142 for (base::string16& str : extension_list) |
| 143 str.insert(0, prefix); | 143 str.insert(0, prefix); |
| 144 return base::JoinString(extension_list, base::ASCIIToUTF16("\n")); | 144 return JoinString(extension_list, base::ASCIIToUTF16("\n")); |
| 145 } | 145 } |
| 146 | 146 |
| 147 const ExtensionIdList& ExtensionMessageBubbleController::GetExtensionIdList() { | 147 const ExtensionIdList& ExtensionMessageBubbleController::GetExtensionIdList() { |
| 148 return *GetOrCreateExtensionList(); | 148 return *GetOrCreateExtensionList(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool ExtensionMessageBubbleController::CloseOnDeactivate() { return false; } | 151 bool ExtensionMessageBubbleController::CloseOnDeactivate() { return false; } |
| 152 | 152 |
| 153 void ExtensionMessageBubbleController::HighlightExtensionsIfNecessary() { | 153 void ExtensionMessageBubbleController::HighlightExtensionsIfNecessary() { |
| 154 if (delegate_->ShouldHighlightExtensions() && !did_highlight_) { | 154 if (delegate_->ShouldHighlightExtensions() && !did_highlight_) { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 return &extension_list_; | 233 return &extension_list_; |
| 234 } | 234 } |
| 235 | 235 |
| 236 void ExtensionMessageBubbleController::OnClose() { | 236 void ExtensionMessageBubbleController::OnClose() { |
| 237 AcknowledgeExtensions(); | 237 AcknowledgeExtensions(); |
| 238 if (did_highlight_) | 238 if (did_highlight_) |
| 239 ExtensionToolbarModel::Get(profile_)->StopHighlighting(); | 239 ExtensionToolbarModel::Get(profile_)->StopHighlighting(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace extensions | 242 } // namespace extensions |
| OLD | NEW |