| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 #if defined(OS_CHROMEOS) | 93 #if defined(OS_CHROMEOS) |
| 94 // There's no need to show the sign in promo on cros since cros users are | 94 // There's no need to show the sign in promo on cros since cros users are |
| 95 // already logged in. | 95 // already logged in. |
| 96 return false; | 96 return false; |
| 97 #else | 97 #else |
| 98 | 98 |
| 99 // Don't bother if we don't have any kind of network connection. | 99 // Don't bother if we don't have any kind of network connection. |
| 100 if (net::NetworkChangeNotifier::IsOffline()) | 100 if (net::NetworkChangeNotifier::IsOffline()) |
| 101 return false; | 101 return false; |
| 102 | 102 |
| 103 // Don't show for managed profiles. | 103 // Don't show for supervised profiles. |
| 104 if (profile->IsManaged()) | 104 if (profile->IsSupervised()) |
| 105 return false; | 105 return false; |
| 106 | 106 |
| 107 // Display the signin promo if the user is not signed in. | 107 // Display the signin promo if the user is not signed in. |
| 108 SigninManager* signin = SigninManagerFactory::GetForProfile( | 108 SigninManager* signin = SigninManagerFactory::GetForProfile( |
| 109 profile->GetOriginalProfile()); | 109 profile->GetOriginalProfile()); |
| 110 return !signin->AuthInProgress() && signin->IsSigninAllowed() && | 110 return !signin->AuthInProgress() && signin->IsSigninAllowed() && |
| 111 signin->GetAuthenticatedUsername().empty(); | 111 signin->GetAuthenticatedUsername().empty(); |
| 112 #endif | 112 #endif |
| 113 } | 113 } |
| 114 | 114 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 prefs::kSignInPromoShowOnFirstRunAllowed, | 325 prefs::kSignInPromoShowOnFirstRunAllowed, |
| 326 true, | 326 true, |
| 327 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 327 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 328 registry->RegisterBooleanPref( | 328 registry->RegisterBooleanPref( |
| 329 prefs::kSignInPromoShowNTPBubble, | 329 prefs::kSignInPromoShowNTPBubble, |
| 330 false, | 330 false, |
| 331 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 331 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace signin | 334 } // namespace signin |
| OLD | NEW |