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

Side by Side Diff: components/signin/core/browser/signin_client.cc

Issue 2712883005: Sign out profile when local_state file has been changed. (Closed)
Patch Set: Merge from master Created 3 years, 9 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 "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
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 }
OLDNEW
« no previous file with comments | « components/signin/core/browser/signin_client.h ('k') | components/signin/core/browser/signin_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698