| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "ui/base/text/text_elider.h" | 7 #include "ui/base/text/text_elider.h" |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/i18n/break_iterator.h" | 10 #include "base/i18n/break_iterator.h" |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 url_parse::Parsed parsed; | 393 url_parse::Parsed parsed; |
| 394 display_url_ = net::FormatUrl(url, languages, | 394 display_url_ = net::FormatUrl(url, languages, |
| 395 net::kFormatUrlOmitAll, UnescapeRule::SPACES, &parsed, &prefix_end_, | 395 net::kFormatUrlOmitAll, UnescapeRule::SPACES, &parsed, &prefix_end_, |
| 396 NULL); | 396 NULL); |
| 397 if (sort_host_.length() > host_minus_www.length()) { | 397 if (sort_host_.length() > host_minus_www.length()) { |
| 398 prefix_end_ += sort_host_.length() - host_minus_www.length(); | 398 prefix_end_ += sort_host_.length() - host_minus_www.length(); |
| 399 sort_host_.swap(host_minus_www); | 399 sort_host_.swap(host_minus_www); |
| 400 } | 400 } |
| 401 } | 401 } |
| 402 | 402 |
| 403 SortedDisplayURL::SortedDisplayURL() { | 403 SortedDisplayURL::SortedDisplayURL() : prefix_end_(0) { |
| 404 } | 404 } |
| 405 | 405 |
| 406 SortedDisplayURL::~SortedDisplayURL() { | 406 SortedDisplayURL::~SortedDisplayURL() { |
| 407 } | 407 } |
| 408 | 408 |
| 409 int SortedDisplayURL::Compare(const SortedDisplayURL& other, | 409 int SortedDisplayURL::Compare(const SortedDisplayURL& other, |
| 410 icu::Collator* collator) const { | 410 icu::Collator* collator) const { |
| 411 // Compare on hosts first. The host won't contain 'www.'. | 411 // Compare on hosts first. The host won't contain 'www.'. |
| 412 UErrorCode compare_status = U_ZERO_ERROR; | 412 UErrorCode compare_status = U_ZERO_ERROR; |
| 413 UCollationResult host_compare_result = collator->compare( | 413 UCollationResult host_compare_result = collator->compare( |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 | 661 |
| 662 bool ElideRectangleString(const string16& input, size_t max_rows, | 662 bool ElideRectangleString(const string16& input, size_t max_rows, |
| 663 size_t max_cols, bool strict, string16* output) { | 663 size_t max_cols, bool strict, string16* output) { |
| 664 RectangleString rect(max_rows, max_cols, strict, output); | 664 RectangleString rect(max_rows, max_cols, strict, output); |
| 665 rect.Init(); | 665 rect.Init(); |
| 666 rect.AddString(input); | 666 rect.AddString(input); |
| 667 return rect.Finalize(); | 667 return rect.Finalize(); |
| 668 } | 668 } |
| 669 | 669 |
| 670 } // namespace ui | 670 } // namespace ui |
| OLD | NEW |