Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ | |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/files/file_path.h" | |
| 11 #include "base/strings/string16.h" | |
| 12 #include "base/time/time.h" | |
| 13 | |
| 14 namespace gfx { | |
| 15 class Image; | |
| 16 } | |
| 17 | |
| 18 class ProfileInfoCache; | |
| 19 | |
| 20 class ProfileAttributesEntry { | |
| 21 public: | |
| 22 ProfileAttributesEntry(); | |
|
Mike Lerman
2015/07/02 18:01:30
virtual ~ProfileAttributesEntry();
anthonyvd
2015/07/07 21:05:32
Done. Is it a coding guideline thing to have a vir
Mike Lerman
2015/07/08 18:26:34
I think so - I've gotten that as feedback many tim
| |
| 23 | |
| 24 base::string16 GetName() const; | |
| 25 base::string16 GetShortcutName() const; | |
| 26 base::FilePath GetPath() const; | |
| 27 base::Time GetActiveTime() const; | |
| 28 base::string16 GetUserName() const; | |
| 29 const gfx::Image& GetAvatarIcon(); | |
| 30 std::string GetLocalAuthCredentials() const; | |
| 31 std::string GetPasswordChangeDetectionToken() const; | |
| 32 // Note that a return value of false could mean an error in collection or | |
| 33 // that there are currently no background apps running. However, the action | |
| 34 // which results is the same in both cases (thus far). | |
| 35 bool GetBackgroundStatus() const; | |
| 36 base::string16 GetGAIAName() const; | |
| 37 base::string16 GetGAIAGivenName() const; | |
| 38 std::string GetGAIAId() const; | |
| 39 // Returns the GAIA picture for the given profile. This may return NULL | |
| 40 // if the profile does not have a GAIA picture or if the picture must be | |
| 41 // loaded from disk. | |
| 42 const gfx::Image* GetGAIAPicture() const; | |
| 43 bool IsUsingGAIAPicture() const; | |
| 44 bool IsSupervised() const; | |
| 45 bool IsChild() const; | |
| 46 bool IsLegacySupervised() const; | |
| 47 bool IsOmitted() const; | |
| 48 bool IsSigninRequired() const; | |
| 49 std::string GetSupervisedUserId() const; | |
| 50 bool IsEphemeral() const; | |
| 51 bool IsUsingDefaultName() const; | |
| 52 bool IsAuthenticated() const; | |
| 53 bool IsUsingDefaultAvatar() const; | |
| 54 bool IsAuthError() const; | |
| 55 size_t GetAvatarIconIndex() const; | |
| 56 | |
| 57 void SetName(const base::string16& name); | |
| 58 void SetShortcutName(const base::string16& name); | |
| 59 void SetIsOmitted(bool is_omitted); | |
| 60 void SetSupervisedUserId(const std::string& id); | |
| 61 void SetLocalAuthCredentials(const std::string& auth); | |
| 62 void SetPasswordChangeDetectionToken(const std::string& token); | |
| 63 void SetBackgroundStatus(bool running_background_apps); | |
| 64 void SetGAIAName(const base::string16& name); | |
| 65 void SetGAIAGivenName(const base::string16& name); | |
| 66 void SetGAIAPicture(const gfx::Image* image); | |
| 67 void SetIsUsingGAIAPicture(bool value); | |
| 68 void SetIsSigninRequired(bool value); | |
| 69 void SetIsEphemeral(bool value); | |
| 70 void SetIsUsingDefaultName(bool value); | |
| 71 void SetIsUsingDefaultAvatar(bool value); | |
| 72 void SetIsAuthError(bool value); | |
| 73 void SetAvatarIconIndex(size_t icon_index); | |
| 74 | |
| 75 void SetAuthInfo(const std::string& gaia_id, | |
| 76 const base::string16& user_name); | |
| 77 | |
| 78 private: | |
| 79 // These members are an implementation detail meant to smooth the migration | |
| 80 // of the ProfileInfoCache to the ProfileAttributesStorage interface. They can | |
| 81 // be safely removed once the ProfileInfoCache stops using indices | |
| 82 // internally. | |
| 83 // TODO(anthonyvd): Remove ProfileInfoCache related implementation details | |
| 84 // when this class holds the members required to fulfill its own contract. | |
| 85 friend class ProfileInfoCache; | |
| 86 ProfileAttributesEntry(ProfileInfoCache* cache, size_t index); | |
| 87 ProfileInfoCache* profile_info_cache_; | |
| 88 size_t profile_index_; | |
| 89 }; | |
| 90 | |
| 91 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ | |
| OLD | NEW |