OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/profiles/profiles_state.h" | 5 #include "chrome/browser/profiles/profiles_state.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/prefs/pref_registry_simple.h" | 8 #include "base/prefs/pref_registry_simple.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 accounts.erase(primary_index); | 131 accounts.erase(primary_index); |
132 | 132 |
133 return accounts; | 133 return accounts; |
134 } | 134 } |
135 | 135 |
136 bool IsRegularOrGuestSession(Browser* browser) { | 136 bool IsRegularOrGuestSession(Browser* browser) { |
137 Profile* profile = browser->profile(); | 137 Profile* profile = browser->profile(); |
138 return profile->IsGuestSession() || !profile->IsOffTheRecord(); | 138 return profile->IsGuestSession() || !profile->IsOffTheRecord(); |
139 } | 139 } |
140 | 140 |
141 void UpdateGaiaProfilePhotoIfNeeded(Profile* profile) { | 141 void UpdateIsProfileLockEnabledIfNeeded(Profile* profile) { |
142 DCHECK(switches::IsNewProfileManagement()); | |
143 DCHECK(switches::IsGoogleProfileInfo()); | |
noms (inactive)
2014/09/15 18:52:40
Maybe you should remove the IsGoogleProfileInfo DC
Mike Lerman
2014/09/15 19:51:41
Done.
| |
144 DCHECK(profile); | |
145 | |
146 PrefService* pref_service = profile->GetPrefs(); | |
147 int lock_status_version = | |
148 pref_service->GetInteger(prefs::kProfileIsLockableVersion); | |
149 if (lock_status_version == profiles::kCurrentLockAlgorithmVersion) | |
150 return; | |
151 | |
152 GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update(); | |
153 } | |
154 | |
155 void UpdateGaiaProfileInfoIfNeeded(Profile* profile) { | |
142 // If the --google-profile-info flag isn't used, then the | 156 // If the --google-profile-info flag isn't used, then the |
143 // GAIAInfoUpdateService isn't initialized, and we can't download the picture. | 157 // GAIAInfoUpdateService isn't initialized, and we can't download the profile |
158 // info. | |
144 if (!switches::IsGoogleProfileInfo()) | 159 if (!switches::IsGoogleProfileInfo()) |
145 return; | 160 return; |
146 | 161 |
147 DCHECK(profile); | 162 DCHECK(profile); |
148 GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update(); | 163 GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update(); |
149 } | 164 } |
150 | 165 |
151 SigninErrorController* GetSigninErrorController(Profile* profile) { | 166 SigninErrorController* GetSigninErrorController(Profile* profile) { |
152 ProfileOAuth2TokenService* token_service = | 167 ProfileOAuth2TokenService* token_service = |
153 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); | 168 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); |
154 return token_service ? token_service->signin_error_controller() : NULL; | 169 return token_service ? token_service->signin_error_controller() : NULL; |
155 } | 170 } |
156 | 171 |
157 } // namespace profiles | 172 } // namespace profiles |
OLD | NEW |