| OLD | NEW |
| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 if (profile_->IsLegacySupervised()) { | 135 if (profile_->IsLegacySupervised()) { |
| 136 LOG(ERROR) << "Attempt to revoke supervised user refresh " | 136 LOG(ERROR) << "Attempt to revoke supervised user refresh " |
| 137 << "token detected, ignoring."; | 137 << "token detected, ignoring."; |
| 138 return false; | 138 return false; |
| 139 } | 139 } |
| 140 #endif | 140 #endif |
| 141 return true; | 141 return true; |
| 142 } | 142 } |
| 143 | 143 |
| 144 std::string ChromeSigninClient::GetSigninScopedDeviceId() { | 144 std::string ChromeSigninClient::GetSigninScopedDeviceId() { |
| 145 if (CommandLine::ForCurrentProcess()->HasSwitch( | 145 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 146 switches::kDisableSigninScopedDeviceId)) { | 146 switches::kDisableSigninScopedDeviceId)) { |
| 147 return std::string(); | 147 return std::string(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 std::string signin_scoped_device_id = | 150 std::string signin_scoped_device_id = |
| 151 GetPrefs()->GetString(prefs::kGoogleServicesSigninScopedDeviceId); | 151 GetPrefs()->GetString(prefs::kGoogleServicesSigninScopedDeviceId); |
| 152 if (signin_scoped_device_id.empty()) { | 152 if (signin_scoped_device_id.empty()) { |
| 153 // If device_id doesn't exist then generate new and save in prefs. | 153 // If device_id doesn't exist then generate new and save in prefs. |
| 154 signin_scoped_device_id = base::GenerateGUID(); | 154 signin_scoped_device_id = base::GenerateGUID(); |
| 155 DCHECK(!signin_scoped_device_id.empty()); | 155 DCHECK(!signin_scoped_device_id.empty()); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 void ChromeSigninClient::PostSignedIn(const std::string& account_id, | 226 void ChromeSigninClient::PostSignedIn(const std::string& account_id, |
| 227 const std::string& username, | 227 const std::string& username, |
| 228 const std::string& password) { | 228 const std::string& password) { |
| 229 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) | 229 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) |
| 230 // Don't store password hash except when lock is available for the user. | 230 // Don't store password hash except when lock is available for the user. |
| 231 if (!password.empty() && profiles::IsLockAvailable(profile_)) | 231 if (!password.empty() && profiles::IsLockAvailable(profile_)) |
| 232 chrome::SetLocalAuthCredentials(profile_, password); | 232 chrome::SetLocalAuthCredentials(profile_, password); |
| 233 #endif | 233 #endif |
| 234 } | 234 } |
| OLD | NEW |