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_manager_base.h" | 5 #include "components/signin/core/browser/signin_manager_base.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/memory/ptr_util.h" |
11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
12 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
14 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
15 #include "components/pref_registry/pref_registry_syncable.h" | 16 #include "components/pref_registry/pref_registry_syncable.h" |
16 #include "components/prefs/pref_service.h" | 17 #include "components/prefs/pref_service.h" |
17 #include "components/signin/core/browser/account_info.h" | 18 #include "components/signin/core/browser/account_info.h" |
18 #include "components/signin/core/browser/account_tracker_service.h" | 19 #include "components/signin/core/browser/account_tracker_service.h" |
19 #include "components/signin/core/browser/signin_client.h" | 20 #include "components/signin/core/browser/signin_client.h" |
20 #include "components/signin/core/common/signin_pref_names.h" | 21 #include "components/signin/core/common/signin_pref_names.h" |
(...skipping 30 matching lines...) Expand all Loading... |
51 prefs::kGoogleServicesRefreshTokenAnnotateScheduledTime, | 52 prefs::kGoogleServicesRefreshTokenAnnotateScheduledTime, |
52 base::Time().ToInternalValue()); | 53 base::Time().ToInternalValue()); |
53 registry->RegisterStringPref(prefs::kGoogleServicesSigninScopedDeviceId, | 54 registry->RegisterStringPref(prefs::kGoogleServicesSigninScopedDeviceId, |
54 std::string()); | 55 std::string()); |
55 registry->RegisterStringPref(prefs::kGoogleServicesAccountId, std::string()); | 56 registry->RegisterStringPref(prefs::kGoogleServicesAccountId, std::string()); |
56 registry->RegisterStringPref(prefs::kGoogleServicesUserAccountId, | 57 registry->RegisterStringPref(prefs::kGoogleServicesUserAccountId, |
57 std::string()); | 58 std::string()); |
58 registry->RegisterBooleanPref(prefs::kAutologinEnabled, true); | 59 registry->RegisterBooleanPref(prefs::kAutologinEnabled, true); |
59 registry->RegisterBooleanPref(prefs::kReverseAutologinEnabled, true); | 60 registry->RegisterBooleanPref(prefs::kReverseAutologinEnabled, true); |
60 registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList, | 61 registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList, |
61 new base::ListValue); | 62 base::MakeUnique<base::ListValue>()); |
62 registry->RegisterBooleanPref(prefs::kSigninAllowed, true); | 63 registry->RegisterBooleanPref(prefs::kSigninAllowed, true); |
63 registry->RegisterInt64Pref(prefs::kSignedInTime, | 64 registry->RegisterInt64Pref(prefs::kSignedInTime, |
64 base::Time().ToInternalValue()); | 65 base::Time().ToInternalValue()); |
65 | 66 |
66 // Deprecated prefs: will be removed in a future release. | 67 // Deprecated prefs: will be removed in a future release. |
67 registry->RegisterStringPref(prefs::kGoogleServicesUsername, std::string()); | 68 registry->RegisterStringPref(prefs::kGoogleServicesUsername, std::string()); |
68 } | 69 } |
69 | 70 |
70 // static | 71 // static |
71 void SigninManagerBase::RegisterPrefs(PrefRegistrySimple* registry) { | 72 void SigninManagerBase::RegisterPrefs(PrefRegistrySimple* registry) { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 SigninDiagnosticsObserver* observer) { | 251 SigninDiagnosticsObserver* observer) { |
251 signin_diagnostics_observers_.RemoveObserver(observer); | 252 signin_diagnostics_observers_.RemoveObserver(observer); |
252 } | 253 } |
253 | 254 |
254 void SigninManagerBase::NotifyDiagnosticsObservers( | 255 void SigninManagerBase::NotifyDiagnosticsObservers( |
255 const TimedSigninStatusField& field, | 256 const TimedSigninStatusField& field, |
256 const std::string& value) { | 257 const std::string& value) { |
257 for (auto& observer : signin_diagnostics_observers_) | 258 for (auto& observer : signin_diagnostics_observers_) |
258 observer.NotifySigninValueChanged(field, value); | 259 observer.NotifySigninValueChanged(field, value); |
259 } | 260 } |
OLD | NEW |