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

Unified Diff: chrome/browser/chromeos/policy/device_local_account.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/policy/device_local_account.h
diff --git a/chrome/browser/chromeos/policy/device_local_account.h b/chrome/browser/chromeos/policy/device_local_account.h
index 88271192ab4c6c2393bbc7c51ccaa36ddcae60d3..71de8e86ebb2d503fd5d6f3b7ad70047679de375 100644
--- a/chrome/browser/chromeos/policy/device_local_account.h
+++ b/chrome/browser/chromeos/policy/device_local_account.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include "components/user_manager/user_id.h"
+
namespace chromeos {
class CrosSettings;
class OwnerSettingsServiceChromeOS;
@@ -39,9 +41,10 @@ struct DeviceLocalAccount {
// account. The only constraints are that the |account_id| be unique and,
// for legacy reasons, it contain an @ symbol.
// * The |user_id| is a synthesized identifier that is guaranteed to be
- // unique, contain an @ symbol, not collide with the |user_id| of any other
- // user on the device (such as regular users or supervised users) and be
- // identifiable as belonging to a device-local account by.
+ // unique, which email contains an @ symbol, doesn not collide with the
+ // |user_id| of any other user on the device (such as regular users or
+ // supervised users) and be identifiable as belonging to a device-local
+ // account by.
// The |account_id| is primarily used by policy code: If device policy defines
// a device-local account with a certain |account_id|, the user policy for
// that account has to be fetched by referencing the same |account_id|.
@@ -52,17 +55,17 @@ struct DeviceLocalAccount {
// another |user_id| on the device and cannot be easily identified as
// belonging to a device-local account.
std::string account_id;
- std::string user_id;
+ user_manager::UserID user_id;
std::string kiosk_app_id;
std::string kiosk_app_update_url;
};
-std::string GenerateDeviceLocalAccountUserId(const std::string& account_id,
+user_manager::UserID GenerateDeviceLocalAccountUserId(const std::string& account_id,
DeviceLocalAccount::Type type);
// Determines whether |user_id| belongs to a device-local account and if so,
// returns the type of device-local account in |type| unless |type| is NULL.
-bool IsDeviceLocalAccountUser(const std::string& user_id,
+bool IsDeviceLocalAccountUser(const user_manager::UserID& user_id,
DeviceLocalAccount::Type* type);
// Stores a list of device-local accounts in |service|. The accounts are stored

Powered by Google App Engine
This is Rietveld 408576698