| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/users/wallpaper/wallpaper_manager.h" | 5 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
| 10 #include "ash/public/cpp/shelf_types.h" | 10 #include "ash/public/cpp/shelf_types.h" |
| (...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 chromeos::switches::kChildWallpaperLarge); | 1359 chromeos::switches::kChildWallpaperLarge); |
| 1360 default_wallpaper_image_.reset(); | 1360 default_wallpaper_image_.reset(); |
| 1361 } | 1361 } |
| 1362 | 1362 |
| 1363 void WallpaperManager::OnDefaultWallpaperDecoded( | 1363 void WallpaperManager::OnDefaultWallpaperDecoded( |
| 1364 const base::FilePath& path, | 1364 const base::FilePath& path, |
| 1365 const wallpaper::WallpaperLayout layout, | 1365 const wallpaper::WallpaperLayout layout, |
| 1366 std::unique_ptr<user_manager::UserImage>* result_out, | 1366 std::unique_ptr<user_manager::UserImage>* result_out, |
| 1367 MovableOnDestroyCallbackHolder on_finish, | 1367 MovableOnDestroyCallbackHolder on_finish, |
| 1368 std::unique_ptr<user_manager::UserImage> user_image) { | 1368 std::unique_ptr<user_manager::UserImage> user_image) { |
| 1369 if (user_image->image().isNull()) { |
| 1370 LOG(ERROR) << "Failed to decode default wallpaper. "; |
| 1371 return; |
| 1372 } |
| 1373 |
| 1369 *result_out = std::move(user_image); | 1374 *result_out = std::move(user_image); |
| 1370 SetWallpaper((*result_out)->image(), layout); | 1375 SetWallpaper((*result_out)->image(), layout); |
| 1371 } | 1376 } |
| 1372 | 1377 |
| 1373 void WallpaperManager::StartLoadAndSetDefaultWallpaper( | 1378 void WallpaperManager::StartLoadAndSetDefaultWallpaper( |
| 1374 const base::FilePath& path, | 1379 const base::FilePath& path, |
| 1375 const wallpaper::WallpaperLayout layout, | 1380 const wallpaper::WallpaperLayout layout, |
| 1376 MovableOnDestroyCallbackHolder on_finish, | 1381 MovableOnDestroyCallbackHolder on_finish, |
| 1377 std::unique_ptr<user_manager::UserImage>* result_out) { | 1382 std::unique_ptr<user_manager::UserImage>* result_out) { |
| 1378 user_image_loader::StartWithFilePath( | 1383 user_image_loader::StartWithFilePath( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1431 | 1436 |
| 1432 UMA_HISTOGRAM_ENUMERATION( | 1437 UMA_HISTOGRAM_ENUMERATION( |
| 1433 "Ash.Wallpaper.Apps", | 1438 "Ash.Wallpaper.Apps", |
| 1434 wallpaper_manager_util::ShouldUseAndroidWallpapersApp(profile) | 1439 wallpaper_manager_util::ShouldUseAndroidWallpapersApp(profile) |
| 1435 ? WALLPAPERS_APP_ANDROID | 1440 ? WALLPAPERS_APP_ANDROID |
| 1436 : WALLPAPERS_PICKER_APP_CHROMEOS, | 1441 : WALLPAPERS_PICKER_APP_CHROMEOS, |
| 1437 WALLPAPERS_APPS_NUM); | 1442 WALLPAPERS_APPS_NUM); |
| 1438 } | 1443 } |
| 1439 | 1444 |
| 1440 } // namespace chromeos | 1445 } // namespace chromeos |
| OLD | NEW |