OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file implements utility functions for eliding and formatting UI text. | 5 // This file implements utility functions for eliding and formatting UI text. |
6 // | 6 // |
7 // Note that several of the functions declared in text_elider.h are implemented | 7 // Note that several of the functions declared in text_elider.h are implemented |
8 // in this file using helper classes in an unnamed namespace. | 8 // in this file using helper classes in an unnamed namespace. |
9 | 9 |
10 #include "ui/base/text/text_elider.h" | 10 #include "ui/base/text/text_elider.h" |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
16 #include "base/i18n/break_iterator.h" | 16 #include "base/i18n/break_iterator.h" |
17 #include "base/i18n/char_iterator.h" | 17 #include "base/i18n/char_iterator.h" |
18 #include "base/i18n/rtl.h" | 18 #include "base/i18n/rtl.h" |
19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
20 #include "base/string_split.h" | |
21 #include "base/string_util.h" | 20 #include "base/string_util.h" |
| 21 #include "base/strings/string_split.h" |
22 #include "base/sys_string_conversions.h" | 22 #include "base/sys_string_conversions.h" |
23 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
24 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
25 #include "net/base/escape.h" | 25 #include "net/base/escape.h" |
26 #include "net/base/net_util.h" | 26 #include "net/base/net_util.h" |
27 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 27 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
28 #include "third_party/icu/public/common/unicode/rbbi.h" | 28 #include "third_party/icu/public/common/unicode/rbbi.h" |
29 #include "third_party/icu/public/common/unicode/uloc.h" | 29 #include "third_party/icu/public/common/unicode/uloc.h" |
30 #include "ui/gfx/font.h" | 30 #include "ui/gfx/font.h" |
31 | 31 |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 index = char_iterator.getIndex(); | 1122 index = char_iterator.getIndex(); |
1123 } else { | 1123 } else { |
1124 // String has leading whitespace, return the elide string. | 1124 // String has leading whitespace, return the elide string. |
1125 return kElideString; | 1125 return kElideString; |
1126 } | 1126 } |
1127 } | 1127 } |
1128 return string.substr(0, index) + kElideString; | 1128 return string.substr(0, index) + kElideString; |
1129 } | 1129 } |
1130 | 1130 |
1131 } // namespace ui | 1131 } // namespace ui |
OLD | NEW |