| 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 "components/signin/core/browser/signin_client.h" | 5 #include "components/signin/core/browser/signin_client.h" |
| 6 | 6 |
| 7 #include "base/guid.h" | 7 #include "base/guid.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "components/prefs/pref_service.h" | 9 #include "components/prefs/pref_service.h" |
| 10 #include "components/signin/core/common/signin_pref_names.h" | 10 #include "components/signin/core/common/signin_pref_names.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 if (signin_scoped_device_id.empty()) { | 25 if (signin_scoped_device_id.empty()) { |
| 26 // If device_id doesn't exist then generate new and save in prefs. | 26 // If device_id doesn't exist then generate new and save in prefs. |
| 27 signin_scoped_device_id = GenerateSigninScopedDeviceID(false); | 27 signin_scoped_device_id = GenerateSigninScopedDeviceID(false); |
| 28 DCHECK(!signin_scoped_device_id.empty()); | 28 DCHECK(!signin_scoped_device_id.empty()); |
| 29 prefs->SetString(prefs::kGoogleServicesSigninScopedDeviceId, | 29 prefs->SetString(prefs::kGoogleServicesSigninScopedDeviceId, |
| 30 signin_scoped_device_id); | 30 signin_scoped_device_id); |
| 31 } | 31 } |
| 32 return signin_scoped_device_id; | 32 return signin_scoped_device_id; |
| 33 } | 33 } |
| 34 | 34 |
| 35 void SigninClient::PreSignOut(const base::Callback<void()>& sign_out) { |
| 36 sign_out.Run(); |
| 37 } |
| 38 |
| 35 void SigninClient::SignOut() { | 39 void SigninClient::SignOut() { |
| 36 GetPrefs()->ClearPref(prefs::kGoogleServicesSigninScopedDeviceId); | 40 GetPrefs()->ClearPref(prefs::kGoogleServicesSigninScopedDeviceId); |
| 37 OnSignedOut(); | 41 OnSignedOut(); |
| 38 } | 42 } |
| OLD | NEW |