Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: chrome/browser/chromeos/login/users/supervised_user_manager.h

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/users/supervised_user_manager.h
diff --git a/chrome/browser/chromeos/login/users/supervised_user_manager.h b/chrome/browser/chromeos/login/users/supervised_user_manager.h
index 82a4b0c5a474c31ac61a947f85a29be5f3ed6717..4bb0b63c2dedafea17ef4e116a6f8ca9c3183e38 100644
--- a/chrome/browser/chromeos/login/users/supervised_user_manager.h
+++ b/chrome/browser/chromeos/login/users/supervised_user_manager.h
@@ -17,6 +17,7 @@ class PrefRegistrySimple;
namespace user_manager {
class User;
+class UserID;
}
namespace chromeos {
@@ -55,7 +56,7 @@ class SupervisedUserManager {
// Checks if given user have supervised users on this device.
- virtual bool HasSupervisedUsers(const std::string& manager_id) const = 0;
+ virtual bool HasSupervisedUsers(const user_manager::UserID& manager_id) const = 0;
// Creates supervised user with given |display_name| and |local_user_id|
// and persists that to user list. Also links this user identified by
@@ -64,13 +65,13 @@ class SupervisedUserManager {
// was a supervised user with such display name.
// TODO(antrim): Refactor into a single struct to have only 1 getter.
virtual const user_manager::User* CreateUserRecord(
- const std::string& manager_id,
- const std::string& local_user_id,
+ const user_manager::UserID& manager_id,
+ const user_manager::UserID& local_user_id,
const std::string& sync_user_id,
const base::string16& display_name) = 0;
// Generates unique user ID for supervised user.
- virtual std::string GenerateUserId() = 0;
+ virtual user_manager::UserID GenerateUserId() = 0;
// Returns the supervised user with the given |display_name| if found in
// the persistent list. Returns |NULL| otherwise.
@@ -84,30 +85,30 @@ class SupervisedUserManager {
// Returns sync_user_id for supervised user with |user_id| or empty string if
// such user is not found or it doesn't have user_id defined.
- virtual std::string GetUserSyncId(const std::string& user_id) const = 0;
+ virtual std::string GetUserSyncId(const user_manager::UserID& user_id) const = 0;
// Returns the display name for manager of user |user_id| if it is known
// (was previously set by a |SaveUserDisplayName| call).
// Otherwise, returns a manager id.
virtual base::string16 GetManagerDisplayName(
- const std::string& user_id) const = 0;
+ const user_manager::UserID& user_id) const = 0;
// Returns the user id for manager of user |user_id| if it is known (user is
// actually a managed user).
// Otherwise, returns an empty string.
- virtual std::string GetManagerUserId(const std::string& user_id) const = 0;
+ virtual user_manager::UserID GetManagerUserId(const user_manager::UserID& user_id) const = 0;
// Returns the display email for manager of user |user_id| if it is known
// (user is actually a managed user).
// Otherwise, returns an empty string.
- virtual std::string GetManagerDisplayEmail(const std::string& user_id)
+ virtual std::string GetManagerDisplayEmail(const user_manager::UserID& user_id)
const = 0;
// Create a record about starting supervised user creation transaction.
virtual void StartCreationTransaction(const base::string16& display_name) = 0;
// Add user id to supervised user creation transaction record.
- virtual void SetCreationTransactionUserId(const std::string& user_id) = 0;
+ virtual void SetCreationTransactionUserId(const user_manager::UserID& user_id) = 0;
// Remove supervised user creation transaction record.
virtual void CommitCreationTransaction() = 0;
@@ -117,13 +118,13 @@ class SupervisedUserManager {
// Fill |result| with public password-specific data for |user_id| from Local
// State.
- virtual void GetPasswordInformation(const std::string& user_id,
+ virtual void GetPasswordInformation(const user_manager::UserID& user_id,
base::DictionaryValue* result) = 0;
// Stores public password-specific data from |password_info| for |user_id| in
// Local State.
virtual void SetPasswordInformation(
- const std::string& user_id,
+ const user_manager::UserID& user_id,
const base::DictionaryValue* password_info) = 0;
// Loads a sync oauth token in background, and passes it to callback.

Powered by Google App Engine
This is Rietveld 408576698