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_util.h" | |
21 #include "base/strings/string_split.h" | 20 #include "base/strings/string_split.h" |
| 21 #include "base/strings/string_util.h" |
22 #include "base/strings/sys_string_conversions.h" | 22 #include "base/strings/sys_string_conversions.h" |
23 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 index = char_iterator.getIndex(); | 1128 index = char_iterator.getIndex(); |
1129 } else { | 1129 } else { |
1130 // String has leading whitespace, return the elide string. | 1130 // String has leading whitespace, return the elide string. |
1131 return kElideString; | 1131 return kElideString; |
1132 } | 1132 } |
1133 } | 1133 } |
1134 return string.substr(0, index) + kElideString; | 1134 return string.substr(0, index) + kElideString; |
1135 } | 1135 } |
1136 | 1136 |
1137 } // namespace ui | 1137 } // namespace ui |
OLD | NEW |