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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 162393002: Enable surprise me wallpaper for new profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 8 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/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
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"
54 #include "chrome/browser/chromeos/settings/cros_settings.h" 55 #include "chrome/browser/chromeos/settings/cros_settings.h"
55 #include "chrome/browser/extensions/extension_service.h" 56 #include "chrome/browser/extensions/extension_service.h"
56 #include "chrome/browser/first_run/first_run.h" 57 #include "chrome/browser/first_run/first_run.h"
57 #include "chrome/browser/google/google_util_chromeos.h" 58 #include "chrome/browser/google/google_util_chromeos.h"
58 #include "chrome/browser/lifetime/application_lifetime.h" 59 #include "chrome/browser/lifetime/application_lifetime.h"
59 #include "chrome/browser/pref_service_flags_storage.h" 60 #include "chrome/browser/pref_service_flags_storage.h"
60 #include "chrome/browser/profiles/profile.h" 61 #include "chrome/browser/profiles/profile.h"
61 #include "chrome/browser/profiles/profile_manager.h" 62 #include "chrome/browser/profiles/profile_manager.h"
62 #include "chrome/browser/rlz/rlz.h" 63 #include "chrome/browser/rlz/rlz.h"
63 #include "chrome/browser/signin/signin_manager_factory.h" 64 #include "chrome/browser/signin/signin_manager_factory.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? 342 chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ?
342 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; 343 chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN;
343 344
344 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), 345 browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(),
345 profile, 346 profile,
346 base::FilePath(), 347 base::FilePath(),
347 chrome::startup::IS_PROCESS_STARTUP, 348 chrome::startup::IS_PROCESS_STARTUP,
348 first_run, 349 first_run,
349 &return_code); 350 &return_code);
350 351
352 if (UserManager::Get()->IsCurrentUserNew() &&
353 UserManager::Get()->IsLoggedInAsRegularUser()) {
Nikita (slow) 2014/04/08 16:58:27 nit: Can you please add a check that UserManager:
Harry McCleave 2014/04/09 02:41:33 Done.
354 WallpaperManager::Get()->EnableSurpriseMe();
355 }
356
351 // Triggers app launcher start page service to load start page web contents. 357 // Triggers app launcher start page service to load start page web contents.
352 app_list::StartPageService::Get(profile); 358 app_list::StartPageService::Get(profile);
353 359
354 // Mark login host for deletion after browser starts. This 360 // Mark login host for deletion after browser starts. This
355 // guarantees that the message loop will be referenced by the 361 // guarantees that the message loop will be referenced by the
356 // browser before it is dereferenced by the login host. 362 // browser before it is dereferenced by the login host.
357 if (login_host) 363 if (login_host)
358 login_host->Finalize(); 364 login_host->Finalize();
359 UserManager::Get()->SessionStarted(); 365 UserManager::Get()->SessionStarted();
360 } 366 }
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 CrosSettings* cros_settings = CrosSettings::Get(); 954 CrosSettings* cros_settings = CrosSettings::Get();
949 bool allow_new_user = false; 955 bool allow_new_user = false;
950 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 956 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
951 if (allow_new_user) 957 if (allow_new_user)
952 return true; 958 return true;
953 return cros_settings->FindEmailInList( 959 return cros_settings->FindEmailInList(
954 kAccountsPrefUsers, username, wildcard_match); 960 kAccountsPrefUsers, username, wildcard_match);
955 } 961 }
956 962
957 } // namespace chromeos 963 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698