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

Side by Side Diff: chrome/browser/signin/chrome_signin_client.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 unified diff | Download patch
OLDNEW
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 #include "chrome/browser/signin/chrome_signin_client.h" 5 #include "chrome/browser/signin/chrome_signin_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/guid.h" 8 #include "base/guid.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #else 55 #else
56 // UserManager may not exist in unit_tests. 56 // UserManager may not exist in unit_tests.
57 if (!user_manager::UserManager::IsInitialized()) 57 if (!user_manager::UserManager::IsInitialized())
58 return; 58 return;
59 59
60 const user_manager::User* user = 60 const user_manager::User* user =
61 chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); 61 chromeos::ProfileHelper::Get()->GetUserByProfile(profile_);
62 if (!user) 62 if (!user)
63 return; 63 return;
64 auto* user_manager = user_manager::UserManager::Get(); 64 auto* user_manager = user_manager::UserManager::Get();
65 const std::string& user_id = user->GetUserID(); 65 const user_manager::UserID& user_id = user->GetUserID();
66 if (user_manager->GetKnownUserDeviceId(user_id).empty()) { 66 if (user_manager->GetKnownUserDeviceId(user_id).empty()) {
67 const std::string legacy_device_id = 67 const std::string legacy_device_id =
68 GetPrefs()->GetString(prefs::kGoogleServicesSigninScopedDeviceId); 68 GetPrefs()->GetString(prefs::kGoogleServicesSigninScopedDeviceId);
69 if (!legacy_device_id.empty()) { 69 if (!legacy_device_id.empty()) {
70 // Need to move device ID from the old location to the new one, if it has 70 // Need to move device ID from the old location to the new one, if it has
71 // not been done yet. 71 // not been done yet.
72 user_manager->SetKnownUserDeviceId(user_id, legacy_device_id); 72 user_manager->SetKnownUserDeviceId(user_id, legacy_device_id);
73 } else { 73 } else {
74 user_manager->SetKnownUserDeviceId( 74 user_manager->SetKnownUserDeviceId(
75 user_id, 75 user_id,
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 return; 315 return;
316 #else 316 #else
317 // Don't bother if we don't have any kind of network connection. 317 // Don't bother if we don't have any kind of network connection.
318 if (net::NetworkChangeNotifier::IsOffline()) { 318 if (net::NetworkChangeNotifier::IsOffline()) {
319 delayed_callbacks_.push_back(callback); 319 delayed_callbacks_.push_back(callback);
320 } else { 320 } else {
321 callback.Run(); 321 callback.Run();
322 } 322 }
323 #endif 323 #endif
324 } 324 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698