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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 444903002: [cros] user_manager component - move UserManagerBase and UserManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 (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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #include "net/base/net_util.h" 66 #include "net/base/net_util.h"
67 67
68 #if defined(USE_ASH) 68 #if defined(USE_ASH)
69 #include "ash/shell.h" 69 #include "ash/shell.h"
70 #endif 70 #endif
71 71
72 #if defined(OS_CHROMEOS) 72 #if defined(OS_CHROMEOS)
73 #include "chrome/browser/chromeos/app_mode/app_launch_utils.h" 73 #include "chrome/browser/chromeos/app_mode/app_launch_utils.h"
74 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" 74 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
75 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" 75 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
76 #include "chrome/browser/chromeos/login/users/user_manager.h"
77 #include "chrome/browser/chromeos/profiles/profile_helper.h" 76 #include "chrome/browser/chromeos/profiles/profile_helper.h"
78 #include "chrome/browser/lifetime/application_lifetime.h" 77 #include "chrome/browser/lifetime/application_lifetime.h"
79 #include "chromeos/chromeos_switches.h" 78 #include "chromeos/chromeos_switches.h"
79 #include "components/user_manager/user_manager.h"
80 #endif 80 #endif
81 81
82 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) 82 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX)
83 #include "ui/events/x/touch_factory_x11.h" 83 #include "ui/events/x/touch_factory_x11.h"
84 #endif 84 #endif
85 85
86 #if defined(OS_MACOSX) 86 #if defined(OS_MACOSX)
87 #include "chrome/browser/web_applications/web_app_mac.h" 87 #include "chrome/browser/web_applications/web_app_mac.h"
88 #endif 88 #endif
89 89
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 Profile* profile) { 352 Profile* profile) {
353 DCHECK(profile); 353 DCHECK(profile);
354 PrefService* prefs = profile->GetPrefs(); 354 PrefService* prefs = profile->GetPrefs();
355 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); 355 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs);
356 356
357 // IsChromeFirstRun() looks for a sentinel file to determine whether the user 357 // IsChromeFirstRun() looks for a sentinel file to determine whether the user
358 // is starting Chrome for the first time. On Chrome OS, the sentinel is stored 358 // is starting Chrome for the first time. On Chrome OS, the sentinel is stored
359 // in a location shared by all users and the check is meaningless. Query the 359 // in a location shared by all users and the check is meaningless. Query the
360 // UserManager instead to determine whether the user is new. 360 // UserManager instead to determine whether the user is new.
361 #if defined(OS_CHROMEOS) 361 #if defined(OS_CHROMEOS)
362 const bool is_first_run = chromeos::UserManager::Get()->IsCurrentUserNew(); 362 const bool is_first_run =
363 user_manager::UserManager::Get()->IsCurrentUserNew();
363 #else 364 #else
364 const bool is_first_run = first_run::IsChromeFirstRun(); 365 const bool is_first_run = first_run::IsChromeFirstRun();
365 #endif 366 #endif
366 367
367 // The pref has an OS-dependent default value. For the first run only, this 368 // The pref has an OS-dependent default value. For the first run only, this
368 // default is overridden with SessionStartupPref::DEFAULT so that first run 369 // default is overridden with SessionStartupPref::DEFAULT so that first run
369 // behavior (sync promo, welcome page) is consistently invoked. 370 // behavior (sync promo, welcome page) is consistently invoked.
370 // This applies only if the pref is still at its default and has not been 371 // This applies only if the pref is still at its default and has not been
371 // set by the user, managed prefs or policy. 372 // set by the user, managed prefs or policy.
372 if (is_first_run && SessionStartupPref::TypeIsDefault(prefs)) 373 if (is_first_run && SessionStartupPref::TypeIsDefault(prefs))
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 736 }
736 737
737 if (command_line.HasSwitch(switches::kProfileDirectory)) { 738 if (command_line.HasSwitch(switches::kProfileDirectory)) {
738 return user_data_dir.Append( 739 return user_data_dir.Append(
739 command_line.GetSwitchValuePath(switches::kProfileDirectory)); 740 command_line.GetSwitchValuePath(switches::kProfileDirectory));
740 } 741 }
741 742
742 return g_browser_process->profile_manager()->GetLastUsedProfileDir( 743 return g_browser_process->profile_manager()->GetLastUsedProfileDir(
743 user_data_dir); 744 user_data_dir);
744 } 745 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698