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 <numeric> | 7 #include <numeric> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1781 } | 1781 } |
1782 | 1782 |
1783 WallpaperManager::PendingWallpaper* WallpaperManager::GetPendingWallpaper( | 1783 WallpaperManager::PendingWallpaper* WallpaperManager::GetPendingWallpaper( |
1784 const std::string& user_id, | 1784 const std::string& user_id, |
1785 bool delayed) { | 1785 bool delayed) { |
1786 if (!pending_inactive_) { | 1786 if (!pending_inactive_) { |
1787 loading_.push_back(new WallpaperManager::PendingWallpaper( | 1787 loading_.push_back(new WallpaperManager::PendingWallpaper( |
1788 (delayed ? GetWallpaperLoadDelay() | 1788 (delayed ? GetWallpaperLoadDelay() |
1789 : base::TimeDelta::FromMilliseconds(0)), | 1789 : base::TimeDelta::FromMilliseconds(0)), |
1790 user_id)); | 1790 user_id)); |
1791 pending_inactive_ = loading_.back(); | 1791 pending_inactive_ = loading_.back().get(); |
1792 } | 1792 } |
1793 return pending_inactive_; | 1793 return pending_inactive_; |
1794 } | 1794 } |
1795 | 1795 |
1796 void WallpaperManager::RemovePendingWallpaperFromList( | 1796 void WallpaperManager::RemovePendingWallpaperFromList( |
1797 PendingWallpaper* pending) { | 1797 PendingWallpaper* pending) { |
1798 DCHECK(loading_.size() > 0); | 1798 DCHECK(loading_.size() > 0); |
1799 for (WallpaperManager::PendingList::iterator i = loading_.begin(); | 1799 for (WallpaperManager::PendingList::iterator i = loading_.begin(); |
1800 i != loading_.end(); | 1800 i != loading_.end(); |
1801 ++i) { | 1801 ++i) { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 void WallpaperManager::CreateSolidDefaultWallpaper() { | 1942 void WallpaperManager::CreateSolidDefaultWallpaper() { |
1943 loaded_wallpapers_++; | 1943 loaded_wallpapers_++; |
1944 SkBitmap bitmap; | 1944 SkBitmap bitmap; |
1945 bitmap.allocN32Pixels(1, 1); | 1945 bitmap.allocN32Pixels(1, 1); |
1946 bitmap.eraseColor(kDefaultWallpaperColor); | 1946 bitmap.eraseColor(kDefaultWallpaperColor); |
1947 const gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); | 1947 const gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); |
1948 default_wallpaper_image_.reset(new user_manager::UserImage(image)); | 1948 default_wallpaper_image_.reset(new user_manager::UserImage(image)); |
1949 } | 1949 } |
1950 | 1950 |
1951 } // namespace chromeos | 1951 } // namespace chromeos |
OLD | NEW |