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/chromeos/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "chrome/browser/chromeos/login/oauth2_login_manager_factory.h" | 44 #include "chrome/browser/chromeos/login/oauth2_login_manager_factory.h" |
45 #include "chrome/browser/chromeos/login/parallel_authenticator.h" | 45 #include "chrome/browser/chromeos/login/parallel_authenticator.h" |
46 #include "chrome/browser/chromeos/login/profile_auth_data.h" | 46 #include "chrome/browser/chromeos/login/profile_auth_data.h" |
47 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h" | 47 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h" |
48 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory
.h" | 48 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory
.h" |
49 #include "chrome/browser/chromeos/login/screen_locker.h" | 49 #include "chrome/browser/chromeos/login/screen_locker.h" |
50 #include "chrome/browser/chromeos/login/startup_utils.h" | 50 #include "chrome/browser/chromeos/login/startup_utils.h" |
51 #include "chrome/browser/chromeos/login/supervised_user_manager.h" | 51 #include "chrome/browser/chromeos/login/supervised_user_manager.h" |
52 #include "chrome/browser/chromeos/login/user.h" | 52 #include "chrome/browser/chromeos/login/user.h" |
53 #include "chrome/browser/chromeos/login/user_manager.h" | 53 #include "chrome/browser/chromeos/login/user_manager.h" |
54 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | |
55 #include "chrome/browser/chromeos/settings/cros_settings.h" | 54 #include "chrome/browser/chromeos/settings/cros_settings.h" |
56 #include "chrome/browser/extensions/extension_service.h" | 55 #include "chrome/browser/extensions/extension_service.h" |
57 #include "chrome/browser/first_run/first_run.h" | 56 #include "chrome/browser/first_run/first_run.h" |
58 #include "chrome/browser/google/google_util_chromeos.h" | 57 #include "chrome/browser/google/google_util_chromeos.h" |
59 #include "chrome/browser/lifetime/application_lifetime.h" | 58 #include "chrome/browser/lifetime/application_lifetime.h" |
60 #include "chrome/browser/pref_service_flags_storage.h" | 59 #include "chrome/browser/pref_service_flags_storage.h" |
61 #include "chrome/browser/profiles/profile.h" | 60 #include "chrome/browser/profiles/profile.h" |
62 #include "chrome/browser/profiles/profile_manager.h" | 61 #include "chrome/browser/profiles/profile_manager.h" |
63 #include "chrome/browser/rlz/rlz.h" | 62 #include "chrome/browser/rlz/rlz.h" |
64 #include "chrome/browser/signin/signin_manager_factory.h" | 63 #include "chrome/browser/signin/signin_manager_factory.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? | 341 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? |
343 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; | 342 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; |
344 | 343 |
345 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 344 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
346 profile, | 345 profile, |
347 base::FilePath(), | 346 base::FilePath(), |
348 chrome::startup::IS_PROCESS_STARTUP, | 347 chrome::startup::IS_PROCESS_STARTUP, |
349 first_run, | 348 first_run, |
350 &return_code); | 349 &return_code); |
351 | 350 |
352 // If the current user is a new regular user (not including | |
353 // multi-profile cases) enable surprise me wallpaper by default. | |
354 if (UserManager::Get()->IsCurrentUserNew() && | |
355 UserManager::Get()->IsLoggedInAsRegularUser() && | |
356 UserManager::Get()->GetLoggedInUsers().size() == 1) { | |
357 WallpaperManager::Get()->EnableSurpriseMe(); | |
358 } | |
359 | |
360 // Triggers app launcher start page service to load start page web contents. | 351 // Triggers app launcher start page service to load start page web contents. |
361 app_list::StartPageService::Get(profile); | 352 app_list::StartPageService::Get(profile); |
362 | 353 |
363 // Mark login host for deletion after browser starts. This | 354 // Mark login host for deletion after browser starts. This |
364 // guarantees that the message loop will be referenced by the | 355 // guarantees that the message loop will be referenced by the |
365 // browser before it is dereferenced by the login host. | 356 // browser before it is dereferenced by the login host. |
366 if (login_host) | 357 if (login_host) |
367 login_host->Finalize(); | 358 login_host->Finalize(); |
368 UserManager::Get()->SessionStarted(); | 359 UserManager::Get()->SessionStarted(); |
369 } | 360 } |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 CrosSettings* cros_settings = CrosSettings::Get(); | 948 CrosSettings* cros_settings = CrosSettings::Get(); |
958 bool allow_new_user = false; | 949 bool allow_new_user = false; |
959 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 950 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
960 if (allow_new_user) | 951 if (allow_new_user) |
961 return true; | 952 return true; |
962 return cros_settings->FindEmailInList( | 953 return cros_settings->FindEmailInList( |
963 kAccountsPrefUsers, username, wildcard_match); | 954 kAccountsPrefUsers, username, wildcard_match); |
964 } | 955 } |
965 | 956 |
966 } // namespace chromeos | 957 } // namespace chromeos |
OLD | NEW |