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

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

Issue 13468005: Show only the settings pages for new managed users (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 7 years, 8 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
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Don't show if the profile is an incognito. 132 // Don't show if the profile is an incognito.
133 if (profile->IsOffTheRecord()) 133 if (profile->IsOffTheRecord())
134 return false; 134 return false;
135 135
136 // Don't show for managed users.
Dan Beam 2013/04/03 23:39:20 nit: managed profiles
Sergiu 2013/04/04 09:02:55 Done.
137 if (profile->GetPrefs()->GetBoolean(prefs::kProfileIsManaged))
Dan Beam 2013/04/03 23:39:20 do you want to disable the promo based on whether
Dan Beam 2013/04/04 00:01:45 er, if (profile->IsSyncAccessible()) I mean
Dan Beam 2013/04/04 01:12:59 ... and I'm going to go drink more coffee
Sergiu 2013/04/04 09:02:55 It is for managed users (see the referenced bug fo
138 return false;
139
136 // Display the signin promo if the user is not signed in. 140 // Display the signin promo if the user is not signed in.
137 SigninManager* signin = SigninManagerFactory::GetForProfile( 141 SigninManager* signin = SigninManagerFactory::GetForProfile(
138 profile->GetOriginalProfile()); 142 profile->GetOriginalProfile());
139 return !signin->AuthInProgress() && signin->IsSigninAllowed() && 143 return !signin->AuthInProgress() && signin->IsSigninAllowed() &&
140 signin->GetAuthenticatedUsername().empty(); 144 signin->GetAuthenticatedUsername().empty();
141 #endif 145 #endif
142 } 146 }
143 147
144 // static 148 // static
145 void SyncPromoUI::RegisterUserPrefs(PrefRegistrySyncable* registry) { 149 void SyncPromoUI::RegisterUserPrefs(PrefRegistrySyncable* registry) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 g_force_web_based_signin_flow; 310 g_force_web_based_signin_flow;
307 #else 311 #else
308 return false; 312 return false;
309 #endif 313 #endif
310 } 314 }
311 315
312 // static 316 // static
313 void SyncPromoUI::ForceWebBasedSigninFlowForTesting(bool force) { 317 void SyncPromoUI::ForceWebBasedSigninFlowForTesting(bool force) {
314 g_force_web_based_signin_flow = force; 318 g_force_web_based_signin_flow = force;
315 } 319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698