| 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 COMPONENTS_USER_MANAGER_KNOWN_USER_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_KNOWN_USER_H_ |
| 6 #define COMPONENTS_USER_MANAGER_KNOWN_USER_H_ | 6 #define COMPONENTS_USER_MANAGER_KNOWN_USER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "components/user_manager/user_manager_export.h" | 11 #include "components/user_manager/user_manager_export.h" |
| 12 | 12 |
| 13 class AccountId; | 13 class AccountId; |
| 14 enum class AccountType; |
| 14 class PrefRegistrySimple; | 15 class PrefRegistrySimple; |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class DictionaryValue; | 18 class DictionaryValue; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace user_manager { | 21 namespace user_manager { |
| 21 namespace known_user { | 22 namespace known_user { |
| 22 // Methods for storage/retrieval of per-user properties in Local State. | 23 // Methods for storage/retrieval of per-user properties in Local State. |
| 23 | 24 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const std::string& path, | 68 const std::string& path, |
| 68 const int in_value); | 69 const int in_value); |
| 69 | 70 |
| 70 // Returns the list of known AccountIds. | 71 // Returns the list of known AccountIds. |
| 71 std::vector<AccountId> USER_MANAGER_EXPORT GetKnownAccountIds(); | 72 std::vector<AccountId> USER_MANAGER_EXPORT GetKnownAccountIds(); |
| 72 | 73 |
| 73 // This call forms full account id of a known user by email and (optionally) | 74 // This call forms full account id of a known user by email and (optionally) |
| 74 // gaia_id. | 75 // gaia_id. |
| 75 // This is a temporary call while migrating to AccountId. | 76 // This is a temporary call while migrating to AccountId. |
| 76 AccountId USER_MANAGER_EXPORT GetAccountId(const std::string& user_email, | 77 AccountId USER_MANAGER_EXPORT GetAccountId(const std::string& user_email, |
| 77 const std::string& gaia_id); | 78 const std::string& id, |
| 79 const AccountType& account_type); |
| 78 | 80 |
| 79 // Returns true if |subsystem| data was migrated to GaiaId for the |account_id|. | 81 // Returns true if |subsystem| data was migrated to GaiaId for the |account_id|. |
| 80 bool USER_MANAGER_EXPORT GetGaiaIdMigrationStatus(const AccountId& account_id, | 82 bool USER_MANAGER_EXPORT GetGaiaIdMigrationStatus(const AccountId& account_id, |
| 81 const std::string& subsystem); | 83 const std::string& subsystem); |
| 82 | 84 |
| 83 // Marks |subsystem| migrated to GaiaId for the |account_id|. | 85 // Marks |subsystem| migrated to GaiaId for the |account_id|. |
| 84 void USER_MANAGER_EXPORT | 86 void USER_MANAGER_EXPORT |
| 85 SetGaiaIdMigrationStatusDone(const AccountId& account_id, | 87 SetGaiaIdMigrationStatusDone(const AccountId& account_id, |
| 86 const std::string& subsystem); | 88 const std::string& subsystem); |
| 87 | 89 |
| 88 // Updates |gaia_id| for user with |account_id|. | 90 // Updates |gaia_id| for user with |account_id|. |
| 89 // TODO(alemate): Update this once AccountId contains GAIA ID | 91 // TODO(alemate): Update this once AccountId contains GAIA ID |
| 90 // (crbug.com/548926). | 92 // (crbug.com/548926). |
| 91 void USER_MANAGER_EXPORT UpdateGaiaID(const AccountId& account_id, | 93 void USER_MANAGER_EXPORT UpdateGaiaID(const AccountId& account_id, |
| 92 const std::string& gaia_id); | 94 const std::string& gaia_id); |
| 93 | 95 |
| 96 // Updates |account_id.account_type_| and |account_id.GetGaiaId()| or |
| 97 // |account_id.GetObjGuid()| for user with |account_id|. |
| 98 void USER_MANAGER_EXPORT UpdateId(const AccountId& account_id); |
| 99 |
| 94 // Find GAIA ID for user with |account_id|, fill in |out_value| and return | 100 // Find GAIA ID for user with |account_id|, fill in |out_value| and return |
| 95 // true | 101 // true |
| 96 // if GAIA ID was found or false otherwise. | 102 // if GAIA ID was found or false otherwise. |
| 97 // TODO(antrim): Update this once AccountId contains GAIA ID | 103 // TODO(antrim): Update this once AccountId contains GAIA ID |
| 98 // (crbug.com/548926). | 104 // (crbug.com/548926). |
| 99 bool USER_MANAGER_EXPORT FindGaiaID(const AccountId& account_id, | 105 bool USER_MANAGER_EXPORT FindGaiaID(const AccountId& account_id, |
| 100 std::string* out_value); | 106 std::string* out_value); |
| 101 | 107 |
| 102 // Setter and getter for DeviceId known user string preference. | 108 // Setter and getter for DeviceId known user string preference. |
| 103 void USER_MANAGER_EXPORT SetDeviceId(const AccountId& account_id, | 109 void USER_MANAGER_EXPORT SetDeviceId(const AccountId& account_id, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 134 // Removes all user preferences associated with |account_id|. | 140 // Removes all user preferences associated with |account_id|. |
| 135 // (This one used by user_manager only and thus not exported.) | 141 // (This one used by user_manager only and thus not exported.) |
| 136 void RemovePrefs(const AccountId& account_id); | 142 void RemovePrefs(const AccountId& account_id); |
| 137 | 143 |
| 138 // Register known user prefs. | 144 // Register known user prefs. |
| 139 void USER_MANAGER_EXPORT RegisterPrefs(PrefRegistrySimple* registry); | 145 void USER_MANAGER_EXPORT RegisterPrefs(PrefRegistrySimple* registry); |
| 140 } | 146 } |
| 141 } // namespace user_manager | 147 } // namespace user_manager |
| 142 | 148 |
| 143 #endif // COMPONENTS_USER_MANAGER_KNOWN_USER_H_ | 149 #endif // COMPONENTS_USER_MANAGER_KNOWN_USER_H_ |
| OLD | NEW |