| 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) { | 35 void SigninClient::PreSignOut( |
| 36 const base::Callback<void()>& sign_out, |
| 37 signin_metrics::ProfileSignout signout_source_metric) { |
| 36 sign_out.Run(); | 38 sign_out.Run(); |
| 37 } | 39 } |
| 38 | 40 |
| 39 void SigninClient::SignOut() { | 41 void SigninClient::SignOut() { |
| 40 GetPrefs()->ClearPref(prefs::kGoogleServicesSigninScopedDeviceId); | 42 GetPrefs()->ClearPref(prefs::kGoogleServicesSigninScopedDeviceId); |
| 41 OnSignedOut(); | 43 OnSignedOut(); |
| 42 } | 44 } |
| OLD | NEW |