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/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/user_manager_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 NotifyOnLogin(); | 354 NotifyOnLogin(); |
355 } | 355 } |
356 | 356 |
357 void UserManagerImpl::StubUserLoggedIn() { | 357 void UserManagerImpl::StubUserLoggedIn() { |
358 is_current_user_ephemeral_ = true; | 358 is_current_user_ephemeral_ = true; |
359 logged_in_user_ = new User(kStubUser, false); | 359 logged_in_user_ = new User(kStubUser, false); |
360 logged_in_user_->SetImage(GetDefaultImage(kStubDefaultImageIndex), | 360 logged_in_user_->SetImage(GetDefaultImage(kStubDefaultImageIndex), |
361 kStubDefaultImageIndex); | 361 kStubDefaultImageIndex); |
362 } | 362 } |
363 | 363 |
364 void UserManagerImpl::SetLoggedInUserWallpaper() { | 364 void UserManagerImpl::InitializeWallpaper() { |
365 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 365 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
366 | 366 |
367 if (!IsUserLoggedIn() || IsLoggedInAsStub()) { | 367 if (!IsUserLoggedIn()) { |
| 368 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNewOobe)) { |
| 369 bool show_users = true; |
| 370 bool result = CrosSettings::Get()->GetBoolean( |
| 371 kAccountsPrefShowUserNamesOnSignIn, &show_users); |
| 372 DCHECK(result) << "Unable to fetch setting " |
| 373 << kAccountsPrefShowUserNamesOnSignIn; |
| 374 if (!show_users) { |
| 375 ash::Shell::GetInstance()->desktop_background_controller()-> |
| 376 SetDefaultWallpaper(ash::GetSolidColorIndex()); |
| 377 } |
| 378 } |
| 379 return; |
| 380 } else if (IsLoggedInAsStub()) { |
368 ash::Shell::GetInstance()->desktop_background_controller()-> | 381 ash::Shell::GetInstance()->desktop_background_controller()-> |
369 SetDefaultWallpaper(ash::GetInvalidWallpaperIndex()); | 382 SetDefaultWallpaper(ash::GetInvalidWallpaperIndex()); |
370 return; | 383 return; |
371 } | 384 } |
372 UserSelected(GetLoggedInUser().email()); | 385 UserSelected(GetLoggedInUser().email()); |
373 } | 386 } |
374 | 387 |
375 void UserManagerImpl::UserSelected(const std::string& email) { | 388 void UserManagerImpl::UserSelected(const std::string& email) { |
376 if (IsKnownUser(email)) { | 389 if (IsKnownUser(email)) { |
377 User::WallpaperType type; | 390 User::WallpaperType type; |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 ash::GetDefaultWallpaperIndex()); | 1026 ash::GetDefaultWallpaperIndex()); |
1014 } | 1027 } |
1015 } | 1028 } |
1016 } | 1029 } |
1017 } | 1030 } |
1018 | 1031 |
1019 void UserManagerImpl::GetLoggedInUserWallpaperProperties( | 1032 void UserManagerImpl::GetLoggedInUserWallpaperProperties( |
1020 User::WallpaperType* type, | 1033 User::WallpaperType* type, |
1021 int* index) { | 1034 int* index) { |
1022 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1035 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1036 DCHECK(logged_in_user_); |
1023 | 1037 |
1024 if (!IsUserLoggedIn() || IsLoggedInAsStub()) { | 1038 if (IsLoggedInAsStub()) { |
1025 *type = current_user_wallpaper_type_ = User::DEFAULT; | 1039 *type = current_user_wallpaper_type_ = User::DEFAULT; |
1026 *index = current_user_wallpaper_index_ = ash::GetInvalidWallpaperIndex(); | 1040 *index = current_user_wallpaper_index_ = ash::GetInvalidWallpaperIndex(); |
1027 return; | 1041 return; |
1028 } | 1042 } |
1029 | 1043 |
1030 GetUserWallpaperProperties(GetLoggedInUser().email(), type, index); | 1044 GetUserWallpaperProperties(GetLoggedInUser().email(), type, index); |
1031 } | 1045 } |
1032 | 1046 |
1033 void UserManagerImpl::SaveLoggedInUserWallpaperProperties( | 1047 void UserManagerImpl::SaveLoggedInUserWallpaperProperties( |
1034 User::WallpaperType type, | 1048 User::WallpaperType type, |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1525 BrowserThread::PostTask( | 1539 BrowserThread::PostTask( |
1526 BrowserThread::FILE, | 1540 BrowserThread::FILE, |
1527 FROM_HERE, | 1541 FROM_HERE, |
1528 base::Bind(&UserManagerImpl::DeleteUserImage, | 1542 base::Bind(&UserManagerImpl::DeleteUserImage, |
1529 base::Unretained(this), | 1543 base::Unretained(this), |
1530 image_path)); | 1544 image_path)); |
1531 } | 1545 } |
1532 } | 1546 } |
1533 | 1547 |
1534 } // namespace chromeos | 1548 } // namespace chromeos |
OLD | NEW |