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

Unified Diff: chrome/browser/chromeos/settings/device_settings_service.cc

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/settings/device_settings_service.cc
diff --git a/chrome/browser/chromeos/settings/device_settings_service.cc b/chrome/browser/chromeos/settings/device_settings_service.cc
index a696102cd0e141a4895e8c62e05c39a66dea12b3..9d1fac32190625fb7409d2f1ba7cac9e720d3ba2 100644
--- a/chrome/browser/chromeos/settings/device_settings_service.cc
+++ b/chrome/browser/chromeos/settings/device_settings_service.cc
@@ -71,6 +71,7 @@ DeviceSettingsService* DeviceSettingsService::Get() {
DeviceSettingsService::DeviceSettingsService()
: session_manager_client_(NULL),
store_status_(STORE_SUCCESS),
+ user_id_(std::string(), std::string()),
load_retries_left_(kMaxLoadRetries),
weak_factory_(this) {
}
@@ -150,21 +151,21 @@ bool DeviceSettingsService::HasPrivateOwnerKey() {
}
void DeviceSettingsService::InitOwner(
- const std::string& username,
+ const user_manager::UserID& user_id,
const base::WeakPtr<ownership::OwnerSettingsService>&
owner_settings_service) {
- // When InitOwner() is called twice with the same |username| it's
+ // When InitOwner() is called twice with the same |user_id| it's
// worth to reload settings since owner key may become available.
- if (!username_.empty() && username_ != username)
+ if (!user_id_.empty() && user_id_ != user_id)
return;
- username_ = username;
+ user_id_ = user_id;
owner_settings_service_ = owner_settings_service;
EnsureReload(true);
}
-const std::string& DeviceSettingsService::GetUsername() const {
- return username_;
+const user_manager::UserID& DeviceSettingsService::GetUserID() const {
+ return user_id_;
}
ownership::OwnerSettingsService*

Powered by Google App Engine
This is Rietveld 408576698