Chromium Code Reviews| 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; | |
|
Daniel Erat
2012/06/11 16:06:06
initialize this to false or true. you're ignoring
bshe
2012/06/11 17:04:15
Agree.
We should probably also add a DCHECK here?
Daniel Erat
2012/06/11 17:12:10
DCHECK sounds fine, but make sure you do:
bool
| |
| 370 CrosSettings::Get()->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, | |
| 371 &show_users); | |
| 372 if (!show_users) { | |
| 373 ash::Shell::GetInstance()->desktop_background_controller()-> | |
| 374 SetDefaultWallpaper(ash::GetSolidColorIndex()); | |
| 375 } | |
| 376 } | |
| 377 return; | |
| 378 } else if (IsLoggedInAsStub()) { | |
| 368 ash::Shell::GetInstance()->desktop_background_controller()-> | 379 ash::Shell::GetInstance()->desktop_background_controller()-> |
| 369 SetDefaultWallpaper(ash::GetInvalidWallpaperIndex()); | 380 SetDefaultWallpaper(ash::GetInvalidWallpaperIndex()); |
| 370 return; | 381 return; |
| 371 } | 382 } |
| 372 UserSelected(GetLoggedInUser().email()); | 383 UserSelected(GetLoggedInUser().email()); |
| 373 } | 384 } |
| 374 | 385 |
| 375 void UserManagerImpl::UserSelected(const std::string& email) { | 386 void UserManagerImpl::UserSelected(const std::string& email) { |
| 376 if (IsKnownUser(email)) { | 387 if (IsKnownUser(email)) { |
| 377 User::WallpaperType type; | 388 User::WallpaperType type; |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1013 ash::GetDefaultWallpaperIndex()); | 1024 ash::GetDefaultWallpaperIndex()); |
| 1014 } | 1025 } |
| 1015 } | 1026 } |
| 1016 } | 1027 } |
| 1017 } | 1028 } |
| 1018 | 1029 |
| 1019 void UserManagerImpl::GetLoggedInUserWallpaperProperties( | 1030 void UserManagerImpl::GetLoggedInUserWallpaperProperties( |
| 1020 User::WallpaperType* type, | 1031 User::WallpaperType* type, |
| 1021 int* index) { | 1032 int* index) { |
| 1022 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1033 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1034 DCHECK(logged_in_user_); | |
| 1023 | 1035 |
| 1024 if (!IsUserLoggedIn() || IsLoggedInAsStub()) { | 1036 if (IsLoggedInAsStub()) { |
| 1025 *type = current_user_wallpaper_type_ = User::DEFAULT; | 1037 *type = current_user_wallpaper_type_ = User::DEFAULT; |
| 1026 *index = current_user_wallpaper_index_ = ash::GetInvalidWallpaperIndex(); | 1038 *index = current_user_wallpaper_index_ = ash::GetInvalidWallpaperIndex(); |
| 1027 return; | 1039 return; |
| 1028 } | 1040 } |
| 1029 | 1041 |
| 1030 GetUserWallpaperProperties(GetLoggedInUser().email(), type, index); | 1042 GetUserWallpaperProperties(GetLoggedInUser().email(), type, index); |
| 1031 } | 1043 } |
| 1032 | 1044 |
| 1033 void UserManagerImpl::SaveLoggedInUserWallpaperProperties( | 1045 void UserManagerImpl::SaveLoggedInUserWallpaperProperties( |
| 1034 User::WallpaperType type, | 1046 User::WallpaperType type, |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1525 BrowserThread::PostTask( | 1537 BrowserThread::PostTask( |
| 1526 BrowserThread::FILE, | 1538 BrowserThread::FILE, |
| 1527 FROM_HERE, | 1539 FROM_HERE, |
| 1528 base::Bind(&UserManagerImpl::DeleteUserImage, | 1540 base::Bind(&UserManagerImpl::DeleteUserImage, |
| 1529 base::Unretained(this), | 1541 base::Unretained(this), |
| 1530 image_path)); | 1542 image_path)); |
| 1531 } | 1543 } |
| 1532 } | 1544 } |
| 1533 | 1545 |
| 1534 } // namespace chromeos | 1546 } // namespace chromeos |
| OLD | NEW |