OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | |
14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "third_party/icu/source/common/unicode/uversion.h" | |
tapted
2016/02/04 23:10:35
Can this be moved to the.cc? That might remove the
lwchkg
2016/02/05 00:56:22
I guess it simply means that I did not add a prope
anthonyvd
2016/02/05 15:36:31
I'm fine with having a function in ProfileAttribut
| |
16 | 18 |
17 namespace gfx { | 19 namespace gfx { |
18 class Image; | 20 class Image; |
19 } | 21 } |
22 namespace U_ICU_NAMESPACE { | |
tapted
2016/02/04 23:10:36
does `icu` work in place of U_ICU_NAMESPACE ? That
lwchkg
2016/02/05 00:56:22
No. The namespace icu is alias to U_ICU_NAMESPACE
| |
23 class Collator; | |
24 } | |
20 | 25 |
21 class ProfileInfoCache; | 26 class ProfileInfoCache; |
22 | 27 |
23 class ProfileAttributesEntry { | 28 class ProfileAttributesEntry { |
24 public: | 29 public: |
30 // Compares two ProfileAttributesEntry using locale-sensitive comparison of | |
31 // their names. For ties, the profile path is compared next. | |
32 class SortComparator { | |
33 public: | |
34 SortComparator(); | |
35 ~SortComparator(); | |
36 bool operator()(const ProfileAttributesEntry* const a, | |
37 const ProfileAttributesEntry* const b) const; | |
38 private: | |
39 scoped_ptr<icu::Collator> collator_; | |
40 }; | |
tapted
2016/02/04 23:10:36
nit: DISALLOW_COPY_AND_ASSIGN(..)
lwchkg
2016/02/05 00:56:22
Thanks. Forgot to add it back.
| |
41 | |
25 ProfileAttributesEntry(); | 42 ProfileAttributesEntry(); |
26 virtual ~ProfileAttributesEntry() {} | 43 virtual ~ProfileAttributesEntry() {} |
27 | 44 |
28 // Gets the name of the profile, which is the one displayed in the User Menu. | 45 // Gets the name of the profile, which is the one displayed in the User Menu. |
29 base::string16 GetName() const; | 46 base::string16 GetName() const; |
30 | 47 |
31 base::string16 GetShortcutName() const; | 48 base::string16 GetShortcutName() const; |
32 // Gets the path to the profile. Should correspond to the path passed to | 49 // Gets the path to the profile. Should correspond to the path passed to |
33 // ProfileAttributesStorage::GetProfileAttributesWithPath to get this entry. | 50 // ProfileAttributesStorage::GetProfileAttributesWithPath to get this entry. |
34 base::FilePath GetPath() const; | 51 base::FilePath GetPath() const; |
35 base::Time GetActiveTime() const; | 52 base::Time GetActiveTime() const; |
36 // Gets the user name of the signed in profile. This is typically the email | 53 // Gets the user name of the signed in profile. This is typically the email |
37 // address used to sign in and the empty string for profiles that aren't | 54 // address used to sign in and the empty string for profiles that aren't |
38 // signed in to chrome. | 55 // signed in to chrome. |
39 base::string16 GetUserName() const; | 56 base::string16 GetUserName() const; |
40 // Gets the icon used as this profile's avatar. This might not be the icon | 57 // Gets the icon used as this profile's avatar. This might not be the icon |
41 // displayed in the UI if IsUsingGAIAPicture() is true. | 58 // displayed in the UI if IsUsingGAIAPicture() is true. |
42 const gfx::Image& GetAvatarIcon(); | 59 const gfx::Image& GetAvatarIcon() const; |
43 std::string GetLocalAuthCredentials() const; | 60 std::string GetLocalAuthCredentials() const; |
44 std::string GetPasswordChangeDetectionToken() const; | 61 std::string GetPasswordChangeDetectionToken() const; |
45 // Note that a return value of false could mean an error in collection or | 62 // Note that a return value of false could mean an error in collection or |
46 // that there are currently no background apps running. However, the action | 63 // that there are currently no background apps running. However, the action |
47 // which results is the same in both cases (thus far). | 64 // which results is the same in both cases (thus far). |
48 bool GetBackgroundStatus() const; | 65 bool GetBackgroundStatus() const; |
49 // Gets the GAIA full name associated with this profile if it's signed in. | 66 // Gets the GAIA full name associated with this profile if it's signed in. |
50 base::string16 GetGAIAName() const; | 67 base::string16 GetGAIAName() const; |
51 // Gets the GAIA given name associated with this profile if it's signed in. | 68 // Gets the GAIA given name associated with this profile if it's signed in. |
52 base::string16 GetGAIAGivenName() const; | 69 base::string16 GetGAIAGivenName() const; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 friend class ProfileInfoCache; | 151 friend class ProfileInfoCache; |
135 void Initialize(ProfileInfoCache* cache, const base::FilePath& path); | 152 void Initialize(ProfileInfoCache* cache, const base::FilePath& path); |
136 size_t profile_index() const; | 153 size_t profile_index() const; |
137 ProfileInfoCache* profile_info_cache_; | 154 ProfileInfoCache* profile_info_cache_; |
138 base::FilePath profile_path_; | 155 base::FilePath profile_path_; |
139 | 156 |
140 DISALLOW_COPY_AND_ASSIGN(ProfileAttributesEntry); | 157 DISALLOW_COPY_AND_ASSIGN(ProfileAttributesEntry); |
141 }; | 158 }; |
142 | 159 |
143 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ | 160 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ |
OLD | NEW |