OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/about_signin_internals_factory.h" | 5 #include "chrome/browser/signin/about_signin_internals_factory.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/signin/account_tracker_service_factory.h" | 9 #include "chrome/browser/signin/account_tracker_service_factory.h" |
10 #include "chrome/browser/signin/chrome_signin_client_factory.h" | 10 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void AboutSigninInternalsFactory::RegisterProfilePrefs( | 51 void AboutSigninInternalsFactory::RegisterProfilePrefs( |
52 user_prefs::PrefRegistrySyncable* user_prefs) { | 52 user_prefs::PrefRegistrySyncable* user_prefs) { |
53 // SigninManager information for about:signin-internals. | 53 // SigninManager information for about:signin-internals. |
54 | 54 |
55 // TODO(rogerta): leaving untimed fields here for now because legacy | 55 // TODO(rogerta): leaving untimed fields here for now because legacy |
56 // profiles still have these prefs. In three or four version from M43 | 56 // profiles still have these prefs. In three or four version from M43 |
57 // we can probably remove them. | 57 // we can probably remove them. |
58 for (int i = UNTIMED_FIELDS_BEGIN; i < UNTIMED_FIELDS_END; ++i) { | 58 for (int i = UNTIMED_FIELDS_BEGIN; i < UNTIMED_FIELDS_END; ++i) { |
59 const std::string pref_path = SigninStatusFieldToString( | 59 const std::string pref_path = SigninStatusFieldToString( |
60 static_cast<UntimedSigninStatusField>(i)); | 60 static_cast<UntimedSigninStatusField>(i)); |
61 user_prefs->RegisterStringPref( | 61 user_prefs->RegisterStringPref(pref_path.c_str(), std::string()); |
62 pref_path.c_str(), | |
63 std::string(), | |
64 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
65 } | 62 } |
66 | 63 |
67 for (int i = TIMED_FIELDS_BEGIN; i < TIMED_FIELDS_END; ++i) { | 64 for (int i = TIMED_FIELDS_BEGIN; i < TIMED_FIELDS_END; ++i) { |
68 const std::string value = SigninStatusFieldToString( | 65 const std::string value = SigninStatusFieldToString( |
69 static_cast<TimedSigninStatusField>(i)) + ".value"; | 66 static_cast<TimedSigninStatusField>(i)) + ".value"; |
70 const std::string time = SigninStatusFieldToString( | 67 const std::string time = SigninStatusFieldToString( |
71 static_cast<TimedSigninStatusField>(i)) + ".time"; | 68 static_cast<TimedSigninStatusField>(i)) + ".time"; |
72 user_prefs->RegisterStringPref( | 69 user_prefs->RegisterStringPref(value.c_str(), std::string()); |
73 value.c_str(), | 70 user_prefs->RegisterStringPref(time.c_str(), std::string()); |
74 std::string(), | |
75 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
76 user_prefs->RegisterStringPref( | |
77 time.c_str(), | |
78 std::string(), | |
79 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
80 } | 71 } |
81 } | 72 } |
82 | 73 |
83 KeyedService* AboutSigninInternalsFactory::BuildServiceInstanceFor( | 74 KeyedService* AboutSigninInternalsFactory::BuildServiceInstanceFor( |
84 content::BrowserContext* context) const { | 75 content::BrowserContext* context) const { |
85 Profile* profile = Profile::FromBrowserContext(context); | 76 Profile* profile = Profile::FromBrowserContext(context); |
86 AboutSigninInternals* service = new AboutSigninInternals( | 77 AboutSigninInternals* service = new AboutSigninInternals( |
87 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 78 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
88 AccountTrackerServiceFactory::GetForProfile(profile), | 79 AccountTrackerServiceFactory::GetForProfile(profile), |
89 SigninManagerFactory::GetForProfile(profile), | 80 SigninManagerFactory::GetForProfile(profile), |
90 SigninErrorControllerFactory::GetForProfile(profile), | 81 SigninErrorControllerFactory::GetForProfile(profile), |
91 GaiaCookieManagerServiceFactory::GetForProfile(profile)); | 82 GaiaCookieManagerServiceFactory::GetForProfile(profile)); |
92 service->Initialize(ChromeSigninClientFactory::GetForProfile(profile)); | 83 service->Initialize(ChromeSigninClientFactory::GetForProfile(profile)); |
93 return service; | 84 return service; |
94 } | 85 } |
OLD | NEW |