OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_USER_MANAGER_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_H_ | 6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "components/user_manager/user.h" | 10 #include "components/user_manager/user.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // fills in |out_value|. Otherwise returns false. | 356 // fills in |out_value|. Otherwise returns false. |
357 virtual bool GetKnownUserIntegerPref(const AccountId& account_id, | 357 virtual bool GetKnownUserIntegerPref(const AccountId& account_id, |
358 const std::string& path, | 358 const std::string& path, |
359 int* out_value) = 0; | 359 int* out_value) = 0; |
360 | 360 |
361 // Updates user's identified by |account_id| integer preference |path|. | 361 // Updates user's identified by |account_id| integer preference |path|. |
362 virtual void SetKnownUserIntegerPref(const AccountId& account_id, | 362 virtual void SetKnownUserIntegerPref(const AccountId& account_id, |
363 const std::string& path, | 363 const std::string& path, |
364 const int in_value) = 0; | 364 const int in_value) = 0; |
365 | 365 |
366 // Returns true if user's AccountId was found. | 366 // This call forms full account id of a known user by email and (optionally) |
367 // Returns it in |out_account_id|. | 367 // gaia_id. |
368 virtual bool GetKnownUserAccountId(const AccountId& authenticated_account_id, | 368 // This is a temporary call while migrating to AccountId. |
369 AccountId* out_account_id) = 0; | 369 virtual AccountId GetKnownUserAccountIdImpl(const std::string& user_email, |
| 370 const std::string& gaia_id) = 0; |
| 371 |
| 372 // The same as above, but doesn't crash in unit_tests when Usermanager |
| 373 // doesn't exist. |
| 374 static AccountId GetKnownUserAccountId(const std::string& user_email, |
| 375 const std::string& gaia_id); |
370 | 376 |
371 // Updates |gaia_id| for user with |account_id|. | 377 // Updates |gaia_id| for user with |account_id|. |
372 // TODO(alemate): Update this once AccountId contains GAIA ID | 378 // TODO(alemate): Update this once AccountId contains GAIA ID |
373 // (crbug.com/548926). | 379 // (crbug.com/548926). |
374 virtual void UpdateGaiaID(const AccountId& account_id, | 380 virtual void UpdateGaiaID(const AccountId& account_id, |
375 const std::string& gaia_id) = 0; | 381 const std::string& gaia_id) = 0; |
376 | 382 |
377 // Find GAIA ID for user with |account_id|, fill in |out_value| and return | 383 // Find GAIA ID for user with |account_id|, fill in |out_value| and return |
378 // true | 384 // true |
379 // if GAIA ID was found or false otherwise. | 385 // if GAIA ID was found or false otherwise. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 static UserManager* GetForTesting(); | 437 static UserManager* GetForTesting(); |
432 | 438 |
433 // Sets UserManager instance to the given |user_manager|. | 439 // Sets UserManager instance to the given |user_manager|. |
434 // Returns the previous value of the instance. | 440 // Returns the previous value of the instance. |
435 static UserManager* SetForTesting(UserManager* user_manager); | 441 static UserManager* SetForTesting(UserManager* user_manager); |
436 }; | 442 }; |
437 | 443 |
438 } // namespace user_manager | 444 } // namespace user_manager |
439 | 445 |
440 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ | 446 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
OLD | NEW |