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

Side by Side Diff: trunk/src/chrome/browser/profiles/profile_window.cc

Issue 464673002: Revert 288817 "[Mac, Win] Only show the user manager tutorial if..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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 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/profile_window.h" 5 #include "chrome/browser/profiles/profile_window.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 base::string16(), 296 base::string16(),
297 std::string()); 297 std::string());
298 } 298 }
299 299
300 void ShowUserManagerMaybeWithTutorial(Profile* profile) { 300 void ShowUserManagerMaybeWithTutorial(Profile* profile) {
301 // Guest users cannot appear in the User Manager, nor display a tutorial. 301 // Guest users cannot appear in the User Manager, nor display a tutorial.
302 if (!profile || profile->IsGuestSession()) { 302 if (!profile || profile->IsGuestSession()) {
303 chrome::ShowUserManager(base::FilePath()); 303 chrome::ShowUserManager(base::FilePath());
304 return; 304 return;
305 } 305 }
306 chrome::ShowUserManagerWithTutorial(profiles::USER_MANAGER_TUTORIAL_OVERVIEW); 306 // Show the tutorial if the profile has not shown it before.
307 PrefService* pref_service = profile->GetPrefs();
308 bool tutorial_shown = pref_service->GetBoolean(
309 prefs::kProfileUserManagerTutorialShown);
310 if (!tutorial_shown)
311 pref_service->SetBoolean(prefs::kProfileUserManagerTutorialShown, true);
312
313 if (tutorial_shown) {
314 chrome::ShowUserManager(profile->GetPath());
315 } else {
316 chrome::ShowUserManagerWithTutorial(
317 profiles::USER_MANAGER_TUTORIAL_OVERVIEW);
318 }
307 } 319 }
308 320
309 void EnableNewProfileManagementPreview(Profile* profile) { 321 void EnableNewProfileManagementPreview(Profile* profile) {
310 #if defined(OS_ANDROID) 322 #if defined(OS_ANDROID)
311 NOTREACHED(); 323 NOTREACHED();
312 #else 324 #else
313 // TODO(rogerta): instead of setting experiment flags and command line 325 // TODO(rogerta): instead of setting experiment flags and command line
314 // args, we should set a profile preference. 326 // args, we should set a profile preference.
315 const about_flags::Experiment experiment = { 327 const about_flags::Experiment experiment = {
316 kNewProfileManagementExperimentInternalName, 328 kNewProfileManagementExperimentInternalName,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 case BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH: 374 case BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH:
363 return profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH; 375 return profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH;
364 case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT: 376 case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT:
365 return profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; 377 return profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
366 } 378 }
367 NOTREACHED(); 379 NOTREACHED();
368 return profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; 380 return profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
369 } 381 }
370 382
371 } // namespace profiles 383 } // namespace profiles
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/profiles/profile.cc ('k') | trunk/src/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698