| 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/signin/signin_promo.h" | 5 #include "chrome/browser/signin/signin_promo.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return false; | 92 return false; |
| 93 | 93 |
| 94 // Don't show for supervised profiles. | 94 // Don't show for supervised profiles. |
| 95 if (profile->IsSupervised()) | 95 if (profile->IsSupervised()) |
| 96 return false; | 96 return false; |
| 97 | 97 |
| 98 // Display the signin promo if the user is not signed in. | 98 // Display the signin promo if the user is not signed in. |
| 99 SigninManager* signin = SigninManagerFactory::GetForProfile( | 99 SigninManager* signin = SigninManagerFactory::GetForProfile( |
| 100 profile->GetOriginalProfile()); | 100 profile->GetOriginalProfile()); |
| 101 return !signin->AuthInProgress() && signin->IsSigninAllowed() && | 101 return !signin->AuthInProgress() && signin->IsSigninAllowed() && |
| 102 signin->GetAuthenticatedUsername().empty(); | 102 !signin->IsAuthenticated(); |
| 103 #endif | 103 #endif |
| 104 } | 104 } |
| 105 | 105 |
| 106 bool ShouldShowPromoAtStartup(Profile* profile, bool is_new_profile) { | 106 bool ShouldShowPromoAtStartup(Profile* profile, bool is_new_profile) { |
| 107 DCHECK(profile); | 107 DCHECK(profile); |
| 108 | 108 |
| 109 // Don't show if the profile is an incognito. | 109 // Don't show if the profile is an incognito. |
| 110 if (profile->IsOffTheRecord()) | 110 if (profile->IsOffTheRecord()) |
| 111 return false; | 111 return false; |
| 112 | 112 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 prefs::kSignInPromoShowOnFirstRunAllowed, | 327 prefs::kSignInPromoShowOnFirstRunAllowed, |
| 328 true, | 328 true, |
| 329 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 329 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 330 registry->RegisterBooleanPref( | 330 registry->RegisterBooleanPref( |
| 331 prefs::kSignInPromoShowNTPBubble, | 331 prefs::kSignInPromoShowNTPBubble, |
| 332 false, | 332 false, |
| 333 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 333 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 334 } | 334 } |
| 335 | 335 |
| 336 } // namespace signin | 336 } // namespace signin |
| OLD | NEW |