| 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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 base::WorkerPool::PostTask( | 752 base::WorkerPool::PostTask( |
| 753 FROM_HERE, base::Bind(&DeleteWallpaperInList, file_to_remove), false); | 753 FROM_HERE, base::Bind(&DeleteWallpaperInList, file_to_remove), false); |
| 754 } | 754 } |
| 755 | 755 |
| 756 void WallpaperManagerBase::SetCommandLineForTesting( | 756 void WallpaperManagerBase::SetCommandLineForTesting( |
| 757 base::CommandLine* command_line) { | 757 base::CommandLine* command_line) { |
| 758 command_line_for_testing_ = command_line; | 758 command_line_for_testing_ = command_line; |
| 759 SetDefaultWallpaperPathsFromCommandLine(command_line); | 759 SetDefaultWallpaperPathsFromCommandLine(command_line); |
| 760 } | 760 } |
| 761 | 761 |
| 762 CommandLine* WallpaperManagerBase::GetCommandLine() { | 762 base::CommandLine* WallpaperManagerBase::GetCommandLine() { |
| 763 CommandLine* command_line = command_line_for_testing_ | 763 base::CommandLine* command_line = |
| 764 ? command_line_for_testing_ | 764 command_line_for_testing_ ? command_line_for_testing_ |
| 765 : CommandLine::ForCurrentProcess(); | 765 : base::CommandLine::ForCurrentProcess(); |
| 766 return command_line; | 766 return command_line; |
| 767 } | 767 } |
| 768 | 768 |
| 769 void WallpaperManagerBase::LoadWallpaper( | 769 void WallpaperManagerBase::LoadWallpaper( |
| 770 const std::string& user_id, | 770 const std::string& user_id, |
| 771 const WallpaperInfo& info, | 771 const WallpaperInfo& info, |
| 772 bool update_wallpaper, | 772 bool update_wallpaper, |
| 773 MovableOnDestroyCallbackHolder on_finish) { | 773 MovableOnDestroyCallbackHolder on_finish) { |
| 774 base::FilePath wallpaper_dir; | 774 base::FilePath wallpaper_dir; |
| 775 base::FilePath wallpaper_path; | 775 base::FilePath wallpaper_path; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 void WallpaperManagerBase::CreateSolidDefaultWallpaper() { | 1012 void WallpaperManagerBase::CreateSolidDefaultWallpaper() { |
| 1013 loaded_wallpapers_++; | 1013 loaded_wallpapers_++; |
| 1014 SkBitmap bitmap; | 1014 SkBitmap bitmap; |
| 1015 bitmap.allocN32Pixels(1, 1); | 1015 bitmap.allocN32Pixels(1, 1); |
| 1016 bitmap.eraseColor(kDefaultWallpaperColor); | 1016 bitmap.eraseColor(kDefaultWallpaperColor); |
| 1017 const gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); | 1017 const gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); |
| 1018 default_wallpaper_image_.reset(new user_manager::UserImage(image)); | 1018 default_wallpaper_image_.reset(new user_manager::UserImage(image)); |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 } // namespace wallpaper | 1021 } // namespace wallpaper |
| OLD | NEW |