OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef APP_GFX_TEXT_ELIDER_H_ | 5 #ifndef APP_GFX_TEXT_ELIDER_H_ |
6 #define APP_GFX_TEXT_ELIDER_H_ | 6 #define APP_GFX_TEXT_ELIDER_H_ |
7 | 7 |
8 #include <unicode/coll.h> | 8 #include <unicode/coll.h> |
9 #include <unicode/uchar.h> | 9 #include <unicode/uchar.h> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // | 53 // |
54 // SortedDisplayURL is relatively cheap and supports value semantics. | 54 // SortedDisplayURL is relatively cheap and supports value semantics. |
55 class SortedDisplayURL { | 55 class SortedDisplayURL { |
56 public: | 56 public: |
57 SortedDisplayURL(const GURL& url, const std::wstring& languages); | 57 SortedDisplayURL(const GURL& url, const std::wstring& languages); |
58 SortedDisplayURL() {} | 58 SortedDisplayURL() {} |
59 | 59 |
60 // Compares this SortedDisplayURL to |url| using |collator|. Returns a value | 60 // Compares this SortedDisplayURL to |url| using |collator|. Returns a value |
61 // < 0, = 1 or > 0 as to whether this url is less then, equal to or greater | 61 // < 0, = 1 or > 0 as to whether this url is less then, equal to or greater |
62 // than the supplied url. | 62 // than the supplied url. |
63 int Compare(const SortedDisplayURL& other, Collator* collator) const; | 63 int Compare(const SortedDisplayURL& other, icu::Collator* collator) const; |
64 | 64 |
65 // Returns the display string for the URL. | 65 // Returns the display string for the URL. |
66 const string16& display_url() const { return display_url_; } | 66 const string16& display_url() const { return display_url_; } |
67 | 67 |
68 private: | 68 private: |
69 // Returns everything after the host. This is used by Compare if the hosts | 69 // Returns everything after the host. This is used by Compare if the hosts |
70 // match. | 70 // match. |
71 string16 AfterHost() const; | 71 string16 AfterHost() const; |
72 | 72 |
73 // Host name minus 'www.'. Used by Compare. | 73 // Host name minus 'www.'. Used by Compare. |
74 string16 sort_host_; | 74 string16 sort_host_; |
75 | 75 |
76 // End of the prefix (spec and separator) in display_url_. | 76 // End of the prefix (spec and separator) in display_url_. |
77 size_t prefix_end_; | 77 size_t prefix_end_; |
78 | 78 |
79 string16 display_url_; | 79 string16 display_url_; |
80 }; | 80 }; |
81 | 81 |
82 } // namespace gfx. | 82 } // namespace gfx. |
83 | 83 |
84 #endif // APP_GFX_TEXT_ELIDER_H_ | 84 #endif // APP_GFX_TEXT_ELIDER_H_ |
OLD | NEW |