| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ | 5 #ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
| 6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ | 6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/desktop_background/desktop_background_resources.h" | 9 #include "ash/desktop_background/desktop_background_resources.h" |
| 10 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "third_party/skia/include/core/SkBitmap.h" | |
| 15 #include "third_party/skia/include/core/SkColor.h" | |
| 16 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_observer.h" | 15 #include "ui/aura/window_observer.h" |
| 18 #include "ui/compositor/layer.h" | 16 #include "ui/compositor/layer.h" |
| 19 #include "ui/gfx/image/image_skia.h" | 17 #include "ui/gfx/image/image_skia.h" |
| 20 | 18 |
| 19 typedef unsigned int SkColor; |
| 20 |
| 21 namespace aura { | 21 namespace aura { |
| 22 class RootWindow; | 22 class RootWindow; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace ash { | 25 namespace ash { |
| 26 | 26 |
| 27 class UserWallpaperDelegate { | 27 class UserWallpaperDelegate { |
| 28 public: | 28 public: |
| 29 virtual ~UserWallpaperDelegate() {} | 29 virtual ~UserWallpaperDelegate() {} |
| 30 | 30 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 // Gets the desktop background mode. | 63 // Gets the desktop background mode. |
| 64 BackgroundMode desktop_background_mode() const { | 64 BackgroundMode desktop_background_mode() const { |
| 65 return desktop_background_mode_; | 65 return desktop_background_mode_; |
| 66 } | 66 } |
| 67 | 67 |
| 68 gfx::ImageSkia GetWallpaper() const; | 68 gfx::ImageSkia GetWallpaper() const; |
| 69 | 69 |
| 70 WallpaperLayout GetWallpaperLayout() const; | 70 WallpaperLayout GetWallpaperLayout() const; |
| 71 | 71 |
| 72 // Provides current image on the background, or empty SkBitmap if there is | 72 // Provides current image on the background, or empty gfx::ImageSkia if there |
| 73 // no image, e.g. background is solid color. | 73 // is no image, e.g. background is solid color. |
| 74 SkBitmap GetCurrentWallpaperImage(); | 74 gfx::ImageSkia GetCurrentWallpaperImage(); |
| 75 | 75 |
| 76 // Initialize root window's background. | 76 // Initialize root window's background. |
| 77 void OnRootWindowAdded(aura::RootWindow* root_window); | 77 void OnRootWindowAdded(aura::RootWindow* root_window); |
| 78 | 78 |
| 79 // Loads default wallpaper at |index| asynchronously but does not set the | 79 // Loads default wallpaper at |index| asynchronously but does not set the |
| 80 // loaded image to current wallpaper. Resource bundle will cache the loaded | 80 // loaded image to current wallpaper. Resource bundle will cache the loaded |
| 81 // image. | 81 // image. |
| 82 void CacheDefaultWallpaper(int index); | 82 void CacheDefaultWallpaper(int index); |
| 83 | 83 |
| 84 // Loads default wallpaper at |index| asynchronously and sets to current | 84 // Loads default wallpaper at |index| asynchronously and sets to current |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 scoped_refptr<WallpaperOperation> wallpaper_op_; | 166 scoped_refptr<WallpaperOperation> wallpaper_op_; |
| 167 | 167 |
| 168 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; | 168 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; |
| 169 | 169 |
| 170 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); | 170 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 } // namespace ash | 173 } // namespace ash |
| 174 | 174 |
| 175 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ | 175 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
| OLD | NEW |