| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/desktop_background/user_wallpaper_delegate.h" | 5 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 6 | 6 |
| 7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/wm/window_animations.h" | 9 #include "ash/wm/window_animations.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 virtual int GetAnimationDurationOverride() OVERRIDE { | 37 virtual int GetAnimationDurationOverride() OVERRIDE { |
| 38 // Return 0 to select the default. | 38 // Return 0 to select the default. |
| 39 return 0; | 39 return 0; |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual void SetAnimationDurationOverride( | 42 virtual void SetAnimationDurationOverride( |
| 43 int animation_duration_in_ms) OVERRIDE { | 43 int animation_duration_in_ms) OVERRIDE { |
| 44 NOTIMPLEMENTED(); | 44 NOTIMPLEMENTED(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual void UpdateWallpaper() OVERRIDE { | 47 virtual void UpdateWallpaper(bool clear_cache) OVERRIDE { |
| 48 SkBitmap bitmap; | 48 SkBitmap bitmap; |
| 49 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); | 49 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); |
| 50 bitmap.allocPixels(); | 50 bitmap.allocPixels(); |
| 51 bitmap.eraseARGB(255, kBackgroundRed, kBackgroundGreen, kBackgroundBlue); | 51 bitmap.eraseARGB(255, kBackgroundRed, kBackgroundGreen, kBackgroundBlue); |
| 52 #if !defined(NDEBUG) | 52 #if !defined(NDEBUG) |
| 53 // In debug builds we generate a simple pattern that allows visually | 53 // In debug builds we generate a simple pattern that allows visually |
| 54 // notice if transparency is broken. | 54 // notice if transparency is broken. |
| 55 { | 55 { |
| 56 SkAutoLockPixels alp(bitmap); | 56 SkAutoLockPixels alp(bitmap); |
| 57 *bitmap.getAddr32(0,0) = SkColorSetRGB(0, 0, 0); | 57 *bitmap.getAddr32(0,0) = SkColorSetRGB(0, 0, 0); |
| 58 } | 58 } |
| 59 #endif | 59 #endif |
| 60 gfx::ImageSkia wallpaper = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); | 60 gfx::ImageSkia wallpaper = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); |
| 61 ash::Shell::GetInstance()->desktop_background_controller()-> | 61 ash::Shell::GetInstance()->desktop_background_controller()-> |
| 62 SetCustomWallpaper(wallpaper, ash::WALLPAPER_LAYOUT_TILE); | 62 SetCustomWallpaper(wallpaper, ash::WALLPAPER_LAYOUT_TILE); |
| 63 } | 63 } |
| 64 | 64 |
| 65 virtual void InitializeWallpaper() OVERRIDE { | 65 virtual void InitializeWallpaper() OVERRIDE { |
| 66 UpdateWallpaper(); | 66 UpdateWallpaper(false); |
| 67 } | 67 } |
| 68 | 68 |
| 69 virtual void OpenSetWallpaperPage() OVERRIDE { | 69 virtual void OpenSetWallpaperPage() OVERRIDE { |
| 70 } | 70 } |
| 71 | 71 |
| 72 virtual bool CanOpenSetWallpaperPage() OVERRIDE { | 72 virtual bool CanOpenSetWallpaperPage() OVERRIDE { |
| 73 return false; | 73 return false; |
| 74 } | 74 } |
| 75 | 75 |
| 76 virtual void OnWallpaperAnimationFinished() OVERRIDE { | 76 virtual void OnWallpaperAnimationFinished() OVERRIDE { |
| 77 } | 77 } |
| 78 | 78 |
| 79 virtual void OnWallpaperBootAnimationFinished() OVERRIDE { | 79 virtual void OnWallpaperBootAnimationFinished() OVERRIDE { |
| 80 } | 80 } |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); | 83 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace | 86 } // namespace |
| 87 | 87 |
| 88 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { | 88 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { |
| 89 return new UserWallpaperDelegate(); | 89 return new UserWallpaperDelegate(); |
| 90 } | 90 } |
| OLD | NEW |