OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/wallpaper_manager.h" | 5 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // If decoded wallpaper is empty, we are probably failed to decode the file. | 413 // If decoded wallpaper is empty, we are probably failed to decode the file. |
414 // Use default wallpaper in this case. | 414 // Use default wallpaper in this case. |
415 if (wallpaper.image().isNull()) { | 415 if (wallpaper.image().isNull()) { |
416 SetDefaultWallpaper(); | 416 SetDefaultWallpaper(); |
417 return; | 417 return; |
418 } | 418 } |
419 | 419 |
420 bool is_persistent = | 420 bool is_persistent = |
421 !UserManager::Get()->IsUserNonCryptohomeDataEphemeral(username); | 421 !UserManager::Get()->IsUserNonCryptohomeDataEphemeral(username); |
422 | 422 |
423 wallpaper.image().EnsureRepsForSupportedScaleFactors(); | 423 wallpaper.image().EnsureRepsForSupportedScales(); |
424 scoped_ptr<gfx::ImageSkia> deep_copy(wallpaper.image().DeepCopy()); | 424 scoped_ptr<gfx::ImageSkia> deep_copy(wallpaper.image().DeepCopy()); |
425 | 425 |
426 WallpaperInfo wallpaper_info = { | 426 WallpaperInfo wallpaper_info = { |
427 wallpaper_path.value(), | 427 wallpaper_path.value(), |
428 layout, | 428 layout, |
429 type, | 429 type, |
430 // Date field is not used. | 430 // Date field is not used. |
431 base::Time::Now().LocalMidnight() | 431 base::Time::Now().LocalMidnight() |
432 }; | 432 }; |
433 // Block shutdown on this task. Otherwise, we may lost the custom wallpaper | 433 // Block shutdown on this task. Otherwise, we may lost the custom wallpaper |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 // |sequence_token_| here. | 967 // |sequence_token_| here. |
968 wallpaper_loader_->Start(wallpaper_path.value(), 0, sequence_token_, | 968 wallpaper_loader_->Start(wallpaper_path.value(), 0, sequence_token_, |
969 base::Bind(&WallpaperManager::OnWallpaperDecoded, | 969 base::Bind(&WallpaperManager::OnWallpaperDecoded, |
970 base::Unretained(this), | 970 base::Unretained(this), |
971 email, | 971 email, |
972 info.layout, | 972 info.layout, |
973 update_wallpaper)); | 973 update_wallpaper)); |
974 } | 974 } |
975 | 975 |
976 } // namespace chromeos | 976 } // namespace chromeos |
OLD | NEW |