| 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 "components/wallpaper/wallpaper_manager_base.h" | 5 #include "components/wallpaper/wallpaper_manager_base.h" |
| 6 | 6 |
| 7 #include <numeric> | 7 #include <numeric> |
| 8 #include <vector> | 8 #include <vector> |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 file_to_remove.push_back(wallpaper_path.Append(account_id.GetUserEmail())); | 782 file_to_remove.push_back(wallpaper_path.Append(account_id.GetUserEmail())); |
| 783 wallpaper_path = wallpaper_path.Append(path_to_file); | 783 wallpaper_path = wallpaper_path.Append(path_to_file); |
| 784 file_to_remove.push_back(wallpaper_path); | 784 file_to_remove.push_back(wallpaper_path); |
| 785 | 785 |
| 786 // Remove original user wallpaper. | 786 // Remove original user wallpaper. |
| 787 wallpaper_path = GetCustomWallpaperDir(kOriginalWallpaperSubDir); | 787 wallpaper_path = GetCustomWallpaperDir(kOriginalWallpaperSubDir); |
| 788 file_to_remove.push_back(wallpaper_path.Append(account_id.GetUserEmail())); | 788 file_to_remove.push_back(wallpaper_path.Append(account_id.GetUserEmail())); |
| 789 wallpaper_path = wallpaper_path.Append(path_to_file); | 789 wallpaper_path = wallpaper_path.Append(path_to_file); |
| 790 file_to_remove.push_back(wallpaper_path); | 790 file_to_remove.push_back(wallpaper_path); |
| 791 | 791 |
| 792 base::PostTaskWithTraits( | 792 base::PostTaskWithTraits(FROM_HERE, |
| 793 FROM_HERE, base::TaskTraits() | 793 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
| 794 .WithShutdownBehavior( | 794 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
| 795 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) | 795 base::Bind(&DeleteWallpaperInList, file_to_remove)); |
| 796 .WithPriority(base::TaskPriority::BACKGROUND) | |
| 797 .MayBlock(), | |
| 798 base::Bind(&DeleteWallpaperInList, file_to_remove)); | |
| 799 } | 796 } |
| 800 | 797 |
| 801 void WallpaperManagerBase::SetCommandLineForTesting( | 798 void WallpaperManagerBase::SetCommandLineForTesting( |
| 802 base::CommandLine* command_line) { | 799 base::CommandLine* command_line) { |
| 803 command_line_for_testing_ = command_line; | 800 command_line_for_testing_ = command_line; |
| 804 SetDefaultWallpaperPathsFromCommandLine(command_line); | 801 SetDefaultWallpaperPathsFromCommandLine(command_line); |
| 805 } | 802 } |
| 806 | 803 |
| 807 base::CommandLine* WallpaperManagerBase::GetCommandLine() { | 804 base::CommandLine* WallpaperManagerBase::GetCommandLine() { |
| 808 base::CommandLine* command_line = | 805 base::CommandLine* command_line = |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 void WallpaperManagerBase::CreateSolidDefaultWallpaper() { | 1051 void WallpaperManagerBase::CreateSolidDefaultWallpaper() { |
| 1055 loaded_wallpapers_for_test_++; | 1052 loaded_wallpapers_for_test_++; |
| 1056 SkBitmap bitmap; | 1053 SkBitmap bitmap; |
| 1057 bitmap.allocN32Pixels(1, 1); | 1054 bitmap.allocN32Pixels(1, 1); |
| 1058 bitmap.eraseColor(kDefaultWallpaperColor); | 1055 bitmap.eraseColor(kDefaultWallpaperColor); |
| 1059 const gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); | 1056 const gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); |
| 1060 default_wallpaper_image_.reset(new user_manager::UserImage(image)); | 1057 default_wallpaper_image_.reset(new user_manager::UserImage(image)); |
| 1061 } | 1058 } |
| 1062 | 1059 |
| 1063 } // namespace wallpaper | 1060 } // namespace wallpaper |
| OLD | NEW |