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

Unified Diff: chrome/browser/signin/chrome_signin_client.cc

Issue 395013002: Pass signin_scoped_device_id to DeviceInfoSpecifics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/signin/chrome_signin_client.cc
diff --git a/chrome/browser/signin/chrome_signin_client.cc b/chrome/browser/signin/chrome_signin_client.cc
index f39cb0cb7dfa17e68c3d3dcc5ea938f18aee93e3..f1d722c0b9a7c25a93fe65b00d39c337c9d9241c 100644
--- a/chrome/browser/signin/chrome_signin_client.cc
+++ b/chrome/browser/signin/chrome_signin_client.cc
@@ -133,17 +133,22 @@ bool ChromeSigninClient::CanRevokeCredentials() {
}
std::string ChromeSigninClient::GetSigninScopedDeviceId() {
- std::string signin_scoped_device_id =
+ std::string signin_scoped_device_id;
pavely 2014/07/16 00:24:45 I made a mistake in my previous change. If command
+
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableSigninScopedDeviceId)) {
+ return signin_scoped_device_id;
+ }
+ signin_scoped_device_id =
GetPrefs()->GetString(prefs::kGoogleServicesSigninScopedDeviceId);
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableSigninScopedDeviceId) &&
- signin_scoped_device_id.empty()) {
- // If device_id doesn't exist then generate new and save in prefs.
- signin_scoped_device_id = base::GenerateGUID();
- DCHECK(!signin_scoped_device_id.empty());
- GetPrefs()->SetString(prefs::kGoogleServicesSigninScopedDeviceId,
- signin_scoped_device_id);
+ if (!signin_scoped_device_id.empty()) {
+ return signin_scoped_device_id;
}
+ // If device_id doesn't exist then generate new and save in prefs.
+ signin_scoped_device_id = base::GenerateGUID();
+ DCHECK(!signin_scoped_device_id.empty());
+ GetPrefs()->SetString(prefs::kGoogleServicesSigninScopedDeviceId,
+ signin_scoped_device_id);
return signin_scoped_device_id;
}

Powered by Google App Engine
This is Rietveld 408576698