OLD | NEW |
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/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "apps/app_load_service.h" | 10 #include "apps/app_load_service.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 Profile* profile) { | 355 Profile* profile) { |
356 DCHECK(profile); | 356 DCHECK(profile); |
357 PrefService* prefs = profile->GetPrefs(); | 357 PrefService* prefs = profile->GetPrefs(); |
358 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); | 358 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); |
359 | 359 |
360 // IsChromeFirstRun() looks for a sentinel file to determine whether the user | 360 // IsChromeFirstRun() looks for a sentinel file to determine whether the user |
361 // is starting Chrome for the first time. On Chrome OS, the sentinel is stored | 361 // is starting Chrome for the first time. On Chrome OS, the sentinel is stored |
362 // in a location shared by all users and the check is meaningless. Query the | 362 // in a location shared by all users and the check is meaningless. Query the |
363 // UserManager instead to determine whether the user is new. | 363 // UserManager instead to determine whether the user is new. |
364 #if defined(OS_CHROMEOS) | 364 #if defined(OS_CHROMEOS) |
365 const bool is_first_run = chromeos::UserManager::Get()->IsCurrentUserNew(); | 365 const bool is_first_run = chromeos::GetUserManager()->IsCurrentUserNew(); |
366 #else | 366 #else |
367 const bool is_first_run = first_run::IsChromeFirstRun(); | 367 const bool is_first_run = first_run::IsChromeFirstRun(); |
368 #endif | 368 #endif |
369 | 369 |
370 // The pref has an OS-dependent default value. For the first run only, this | 370 // The pref has an OS-dependent default value. For the first run only, this |
371 // default is overridden with SessionStartupPref::DEFAULT so that first run | 371 // default is overridden with SessionStartupPref::DEFAULT so that first run |
372 // behavior (sync promo, welcome page) is consistently invoked. | 372 // behavior (sync promo, welcome page) is consistently invoked. |
373 // This applies only if the pref is still at its default and has not been | 373 // This applies only if the pref is still at its default and has not been |
374 // set by the user, managed prefs or policy. | 374 // set by the user, managed prefs or policy. |
375 if (is_first_run && SessionStartupPref::TypeIsDefault(prefs)) | 375 if (is_first_run && SessionStartupPref::TypeIsDefault(prefs)) |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 } | 735 } |
736 | 736 |
737 if (command_line.HasSwitch(switches::kProfileDirectory)) { | 737 if (command_line.HasSwitch(switches::kProfileDirectory)) { |
738 return user_data_dir.Append( | 738 return user_data_dir.Append( |
739 command_line.GetSwitchValuePath(switches::kProfileDirectory)); | 739 command_line.GetSwitchValuePath(switches::kProfileDirectory)); |
740 } | 740 } |
741 | 741 |
742 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 742 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
743 user_data_dir); | 743 user_data_dir); |
744 } | 744 } |
OLD | NEW |