Chromium Code Reviews| 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 if (!switches::IsNewProfileManagement()) | |
| 143 return; | |
|
noms (inactive)
2014/09/12 19:33:25
Maybe you can just DCHECK that IsNewProfileManagem
Mike Lerman
2014/09/15 14:08:55
fo sho
| |
| 144 | |
| 145 DCHECK(switches::IsGoogleProfileInfo()); | |
| 146 DCHECK(profile); | |
| 147 | |
| 148 PrefService* pref_service = profile->GetPrefs(); | |
| 149 int lock_status_version = | |
| 150 pref_service->GetInteger(prefs::kProfileIsLockableVersion); | |
| 151 if (lock_status_version == profiles::kCurrentLockAlgorithmVersion) | |
| 152 return; | |
| 153 | |
| 154 GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update(); | |
| 155 } | |
| 156 | |
| 157 void UpdateGaiaProfileInfoIfNeeded(Profile* profile) { | |
| 142 // If the --google-profile-info flag isn't used, then the | 158 // If the --google-profile-info flag isn't used, then the |
|
noms (inactive)
2014/09/12 19:33:25
Since you've renamed the function, please update t
Mike Lerman
2014/09/15 14:08:56
Done.
| |
| 143 // GAIAInfoUpdateService isn't initialized, and we can't download the picture. | 159 // GAIAInfoUpdateService isn't initialized, and we can't download the picture. |
| 144 if (!switches::IsGoogleProfileInfo()) | 160 if (!switches::IsGoogleProfileInfo()) |
| 145 return; | 161 return; |
| 146 | 162 |
| 147 DCHECK(profile); | 163 DCHECK(profile); |
| 148 GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update(); | 164 GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update(); |
| 149 } | 165 } |
| 150 | 166 |
| 151 SigninErrorController* GetSigninErrorController(Profile* profile) { | 167 SigninErrorController* GetSigninErrorController(Profile* profile) { |
| 152 ProfileOAuth2TokenService* token_service = | 168 ProfileOAuth2TokenService* token_service = |
| 153 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); | 169 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); |
| 154 return token_service ? token_service->signin_error_controller() : NULL; | 170 return token_service ? token_service->signin_error_controller() : NULL; |
| 155 } | 171 } |
| 156 | 172 |
| 157 } // namespace profiles | 173 } // namespace profiles |
| OLD | NEW |