Index: chrome/browser/profiles/profile_attributes_entry.h |
diff --git a/chrome/browser/profiles/profile_attributes_entry.h b/chrome/browser/profiles/profile_attributes_entry.h |
index 081c5c55557a49fa77cd061df1cae86cf7c506bf..d158f1179352427050691d3c7135f09f19b18bdc 100644 |
--- a/chrome/browser/profiles/profile_attributes_entry.h |
+++ b/chrome/browser/profiles/profile_attributes_entry.h |
@@ -11,8 +11,10 @@ |
#include "base/files/file_path.h" |
#include "base/macros.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/strings/string16.h" |
#include "base/time/time.h" |
+#include "third_party/icu/source/i18n/unicode/coll.h" |
tapted
2016/02/02 00:20:55
this doesn't compile for me on mac: unicode/utypes
lwchkg
2016/02/03 17:18:38
Oh. Can you start the try bot about Mac for me? It
lwchkg
2016/02/04 14:27:06
Find the cause of the error. There's a new depende
|
namespace gfx { |
class Image; |
@@ -22,6 +24,20 @@ class ProfileInfoCache; |
class ProfileAttributesEntry { |
public: |
+ // Compares two ProfileAttributesEntry using locale-sensitive comparison of |
+ // their names. For ties, the profile path is compared next. |
+ class SortComparator { |
+ public: |
+ explicit SortComparator(const icu::Collator* const collator) |
+ : collator_(collator) {} |
+ bool operator()(const ProfileAttributesEntry* const a, |
+ const ProfileAttributesEntry* const b) const; |
+ // Returns a Collator which is used to construct SortComparator. |
+ static scoped_ptr<icu::Collator> GetCollator(); |
+ private: |
+ const icu::Collator* const collator_; |
tapted
2016/01/31 23:04:37
The ownership in this class is not right. You shou
lwchkg
2016/02/01 06:31:20
Before coming to this version, actually I tried wh
tapted
2016/02/02 00:20:55
I think you just need to add a move constructor to
|
+ }; |
+ |
ProfileAttributesEntry(); |
virtual ~ProfileAttributesEntry() {} |
@@ -39,7 +55,7 @@ class ProfileAttributesEntry { |
base::string16 GetUserName() const; |
// Gets the icon used as this profile's avatar. This might not be the icon |
// displayed in the UI if IsUsingGAIAPicture() is true. |
- const gfx::Image& GetAvatarIcon(); |
+ const gfx::Image& GetAvatarIcon() const; |
std::string GetLocalAuthCredentials() const; |
std::string GetPasswordChangeDetectionToken() const; |
// Note that a return value of false could mean an error in collection or |