| 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 WallpaperManager* WallpaperManager::Get() { | 464 WallpaperManager* WallpaperManager::Get() { |
| 465 if (!g_wallpaper_manager) | 465 if (!g_wallpaper_manager) |
| 466 g_wallpaper_manager = new WallpaperManager(); | 466 g_wallpaper_manager = new WallpaperManager(); |
| 467 return g_wallpaper_manager; | 467 return g_wallpaper_manager; |
| 468 } | 468 } |
| 469 | 469 |
| 470 WallpaperManager::WallpaperManager() | 470 WallpaperManager::WallpaperManager() |
| 471 : loaded_wallpapers_(0), | 471 : loaded_wallpapers_(0), |
| 472 command_line_for_testing_(NULL), | 472 command_line_for_testing_(NULL), |
| 473 should_cache_wallpaper_(false), | 473 should_cache_wallpaper_(false), |
| 474 weak_factory_(this), | 474 pending_inactive_(NULL), |
| 475 pending_inactive_(NULL) { | 475 weak_factory_(this) { |
| 476 SetDefaultWallpaperPathsFromCommandLine( | 476 SetDefaultWallpaperPathsFromCommandLine( |
| 477 base::CommandLine::ForCurrentProcess()); | 477 base::CommandLine::ForCurrentProcess()); |
| 478 registrar_.Add(this, | 478 registrar_.Add(this, |
| 479 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 479 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
| 480 content::NotificationService::AllSources()); | 480 content::NotificationService::AllSources()); |
| 481 registrar_.Add(this, | 481 registrar_.Add(this, |
| 482 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, | 482 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, |
| 483 content::NotificationService::AllSources()); | 483 content::NotificationService::AllSources()); |
| 484 registrar_.Add(this, | 484 registrar_.Add(this, |
| 485 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, | 485 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, |
| (...skipping 1456 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 |