| 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" |
| 11 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 const char kBackgroundRed = 70; | 15 const char kBackgroundRed = 70; |
| 16 const char kBackgroundGreen = 70; | 16 const char kBackgroundGreen = 70; |
| 17 const char kBackgroundBlue = 78; | 17 const char kBackgroundBlue = 78; |
| 18 | 18 |
| 19 class UserWallpaperDelegate : public ash::UserWallpaperDelegate { | 19 class UserWallpaperDelegate : public ash::UserWallpaperDelegate { |
| 20 public: | 20 public: |
| 21 UserWallpaperDelegate() { | 21 UserWallpaperDelegate() { |
| 22 } | 22 } |
| 23 | 23 |
| 24 virtual ~UserWallpaperDelegate() { | 24 virtual ~UserWallpaperDelegate() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 virtual int GetAnimationType() OVERRIDE { | 27 virtual int GetAnimationType() OVERRIDE { |
| 28 return ShouldShowInitialAnimation() ? | 28 return ShouldShowInitialAnimation() ? |
| 29 ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE : | 29 ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE : |
| 30 static_cast<int>(views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); | 30 static_cast<int>(wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); |
| 31 } | 31 } |
| 32 | 32 |
| 33 virtual bool ShouldShowInitialAnimation() OVERRIDE { | 33 virtual bool ShouldShowInitialAnimation() OVERRIDE { |
| 34 return true; | 34 return true; |
| 35 } | 35 } |
| 36 | 36 |
| 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 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |