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 // Show the tutorial if the profile has not shown it before. | 306 chrome::ShowUserManagerWithTutorial(profiles::USER_MANAGER_TUTORIAL_OVERVIEW); |
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 } | |
319 } | 307 } |
320 | 308 |
321 void EnableNewProfileManagementPreview(Profile* profile) { | 309 void EnableNewProfileManagementPreview(Profile* profile) { |
322 #if defined(OS_ANDROID) | 310 #if defined(OS_ANDROID) |
323 NOTREACHED(); | 311 NOTREACHED(); |
324 #else | 312 #else |
325 // TODO(rogerta): instead of setting experiment flags and command line | 313 // TODO(rogerta): instead of setting experiment flags and command line |
326 // args, we should set a profile preference. | 314 // args, we should set a profile preference. |
327 const about_flags::Experiment experiment = { | 315 const about_flags::Experiment experiment = { |
328 kNewProfileManagementExperimentInternalName, | 316 kNewProfileManagementExperimentInternalName, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 case BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH: | 362 case BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH: |
375 return profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH; | 363 return profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH; |
376 case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT: | 364 case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT: |
377 return profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 365 return profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
378 } | 366 } |
379 NOTREACHED(); | 367 NOTREACHED(); |
380 return profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 368 return profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
381 } | 369 } |
382 | 370 |
383 } // namespace profiles | 371 } // namespace profiles |
OLD | NEW |