| 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" |
| 11 #include "base/i18n/char_iterator.h" | 11 #include "base/i18n/char_iterator.h" |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/string_split.h" | 13 #include "base/string_split.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/sys_string_conversions.h" | 15 #include "base/sys_string_conversions.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "gfx/font.h" | |
| 18 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 19 #include "net/base/escape.h" | 18 #include "net/base/escape.h" |
| 20 #include "net/base/net_util.h" | 19 #include "net/base/net_util.h" |
| 21 #include "net/base/registry_controlled_domain.h" | 20 #include "net/base/registry_controlled_domain.h" |
| 21 #include "ui/gfx/font.h" |
| 22 | 22 |
| 23 namespace ui { | 23 namespace ui { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 const char* kEllipsis = "\xE2\x80\xA6"; | 27 const char* kEllipsis = "\xE2\x80\xA6"; |
| 28 | 28 |
| 29 // Cuts |text| to be |length| characters long. If |cut_in_middle| is true, the | 29 // Cuts |text| to be |length| characters long. If |cut_in_middle| is true, the |
| 30 // middle of the string is removed to leave equal-length pieces from the | 30 // middle of the string is removed to leave equal-length pieces from the |
| 31 // beginning and end of the string; otherwise, the end of the string is removed | 31 // beginning and end of the string; otherwise, the end of the string is removed |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 | 656 |
| 657 bool ElideRectangleString(const string16& input, size_t max_rows, | 657 bool ElideRectangleString(const string16& input, size_t max_rows, |
| 658 size_t max_cols, string16* output) { | 658 size_t max_cols, string16* output) { |
| 659 RectangleString rect(max_rows, max_cols, output); | 659 RectangleString rect(max_rows, max_cols, output); |
| 660 rect.Init(); | 660 rect.Init(); |
| 661 rect.AddString(input); | 661 rect.AddString(input); |
| 662 return rect.Finalize(); | 662 return rect.Finalize(); |
| 663 } | 663 } |
| 664 | 664 |
| 665 } // namespace ui | 665 } // namespace ui |
| OLD | NEW |