Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Side by Side Diff: chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc

Issue 12088040: Add a SigninAllowed policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits and rebase to ToT. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ui/webui/sync_promo/sync_promo_ui.h" 5 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return false; 125 return false;
126 #else 126 #else
127 127
128 // Don't bother if we don't have any kind of network connection. 128 // Don't bother if we don't have any kind of network connection.
129 if (net::NetworkChangeNotifier::IsOffline()) 129 if (net::NetworkChangeNotifier::IsOffline())
130 return false; 130 return false;
131 131
132 // Display the signin promo if the user is not signed in. 132 // Display the signin promo if the user is not signed in.
133 SigninManager* signin = SigninManagerFactory::GetForProfile( 133 SigninManager* signin = SigninManagerFactory::GetForProfile(
134 profile->GetOriginalProfile()); 134 profile->GetOriginalProfile());
135 return signin->GetAuthenticatedUsername().empty(); 135 return signin->IsSigninAllowed() &&
136 signin->GetAuthenticatedUsername().empty();
136 #endif 137 #endif
137 } 138 }
138 139
139 // static 140 // static
140 void SyncPromoUI::RegisterUserPrefs(PrefRegistrySyncable* registry) { 141 void SyncPromoUI::RegisterUserPrefs(PrefRegistrySyncable* registry) {
141 registry->RegisterIntegerPref(prefs::kSyncPromoStartupCount, 0, 142 registry->RegisterIntegerPref(prefs::kSyncPromoStartupCount, 0,
142 PrefRegistrySyncable::UNSYNCABLE_PREF); 143 PrefRegistrySyncable::UNSYNCABLE_PREF);
143 registry->RegisterBooleanPref(prefs::kSyncPromoUserSkipped, false, 144 registry->RegisterBooleanPref(prefs::kSyncPromoUserSkipped, false,
144 PrefRegistrySyncable::UNSYNCABLE_PREF); 145 PrefRegistrySyncable::UNSYNCABLE_PREF);
145 registry->RegisterBooleanPref(prefs::kSyncPromoShowOnFirstRunAllowed, true, 146 registry->RegisterBooleanPref(prefs::kSyncPromoShowOnFirstRunAllowed, true,
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 g_force_web_based_signin_flow; 302 g_force_web_based_signin_flow;
302 #else 303 #else
303 return false; 304 return false;
304 #endif 305 #endif
305 } 306 }
306 307
307 // static 308 // static
308 void SyncPromoUI::ForceWebBasedSigninFlowForTesting(bool force) { 309 void SyncPromoUI::ForceWebBasedSigninFlowForTesting(bool force) {
309 g_force_web_based_signin_flow = force; 310 g_force_web_based_signin_flow = force;
310 } 311 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698