| 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> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 void SetAvatarIconIndex(size_t icon_index); | 117 void SetAvatarIconIndex(size_t icon_index); |
| 118 | 118 |
| 119 // Get the statistics of the profile. | 119 // Get the statistics of the profile. |
| 120 void SetStatsBrowsingHistory(int value); | 120 void SetStatsBrowsingHistory(int value); |
| 121 void SetStatsPasswords(int value); | 121 void SetStatsPasswords(int value); |
| 122 void SetStatsBookmarks(int value); | 122 void SetStatsBookmarks(int value); |
| 123 void SetStatsSettings(int value); | 123 void SetStatsSettings(int value); |
| 124 | 124 |
| 125 void SetAuthInfo(const std::string& gaia_id, const base::string16& user_name); | 125 void SetAuthInfo(const std::string& gaia_id, const base::string16& user_name); |
| 126 | 126 |
| 127 // Lock/Unlock the profile, should be called only if force-sign-in is enabled. |
| 128 void LockForceSigninProfile(bool is_lock); |
| 129 |
| 127 private: | 130 private: |
| 128 // These members are an implementation detail meant to smooth the migration | 131 // These members are an implementation detail meant to smooth the migration |
| 129 // of the ProfileInfoCache to the ProfileAttributesStorage interface. They can | 132 // of the ProfileInfoCache to the ProfileAttributesStorage interface. They can |
| 130 // be safely removed once the ProfileInfoCache stops using indices | 133 // be safely removed once the ProfileInfoCache stops using indices |
| 131 // internally. | 134 // internally. |
| 132 // TODO(anthonyvd): Remove ProfileInfoCache related implementation details | 135 // TODO(anthonyvd): Remove ProfileInfoCache related implementation details |
| 133 // when this class holds the members required to fulfill its own contract. | 136 // when this class holds the members required to fulfill its own contract. |
| 134 friend class ProfileInfoCache; | 137 friend class ProfileInfoCache; |
| 135 void Initialize(ProfileInfoCache* cache, const base::FilePath& path); | 138 void Initialize(ProfileInfoCache* cache, const base::FilePath& path); |
| 136 size_t profile_index() const; | 139 size_t profile_index() const; |
| 137 ProfileInfoCache* profile_info_cache_; | 140 ProfileInfoCache* profile_info_cache_; |
| 138 base::FilePath profile_path_; | 141 base::FilePath profile_path_; |
| 139 | 142 |
| 143 // A separate boolean flag indicates whether the signin is required when force |
| 144 // signin is enabled. So that the profile locked status will be stored in |
| 145 // memory only and can be easily reset once the policy is turned off. |
| 146 bool is_force_signin_profile_locked_ = false; |
| 147 bool is_force_signin_enabled_; |
| 148 |
| 140 DISALLOW_COPY_AND_ASSIGN(ProfileAttributesEntry); | 149 DISALLOW_COPY_AND_ASSIGN(ProfileAttributesEntry); |
| 141 }; | 150 }; |
| 142 | 151 |
| 143 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ | 152 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ |
| OLD | NEW |