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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |