| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "ash/desktop_background/desktop_background_resources.h" | 10 #include "ash/desktop_background/desktop_background_resources.h" |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 | 13 |
| 14 class SkBitmap; | 14 class SkBitmap; |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 | 17 |
| 18 class UserWallpaperDelegate { | 18 class UserWallpaperDelegate { |
| 19 public: | 19 public: |
| 20 virtual ~UserWallpaperDelegate() {} | 20 virtual ~UserWallpaperDelegate() {} |
| 21 | 21 |
| 22 // Gets the index of user selected wallpaper. | 22 // Loads logged in user wallpaper asynchronously and sets to current wallpaper |
| 23 virtual const int GetUserWallpaperIndex() = 0; | 23 // after loaded. |
| 24 virtual void SetLoggedInUserWallpaper() = 0; |
| 24 | 25 |
| 25 // Opens the set wallpaper page in the browser. | 26 // Opens the set wallpaper page in the browser. |
| 26 virtual void OpenSetWallpaperPage() = 0; | 27 virtual void OpenSetWallpaperPage() = 0; |
| 27 | 28 |
| 28 // Returns true if user can open set wallpaper page. Only guest user returns | 29 // Returns true if user can open set wallpaper page. Only guest user returns |
| 29 // false currently. | 30 // false currently. |
| 30 virtual bool CanOpenSetWallpaperPage() = 0; | 31 virtual bool CanOpenSetWallpaperPage() = 0; |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 // Loads selected desktop wallpaper from file system asynchronously and updates | 34 // Loads selected desktop wallpaper from file system asynchronously and updates |
| (...skipping 17 matching lines...) Expand all Loading... |
| 51 // wallpaper after loaded. | 52 // wallpaper after loaded. |
| 52 void SetDefaultWallpaper(int index); | 53 void SetDefaultWallpaper(int index); |
| 53 | 54 |
| 54 // Sets the user selected custom wallpaper. Called when user selected a file | 55 // Sets the user selected custom wallpaper. Called when user selected a file |
| 55 // from file system or changed the layout of wallpaper. | 56 // from file system or changed the layout of wallpaper. |
| 56 void SetCustomWallpaper(const SkBitmap& wallpaper, WallpaperLayout layout); | 57 void SetCustomWallpaper(const SkBitmap& wallpaper, WallpaperLayout layout); |
| 57 | 58 |
| 58 // Cancels the current wallpaper loading operation. | 59 // Cancels the current wallpaper loading operation. |
| 59 void CancelPendingWallpaperOperation(); | 60 void CancelPendingWallpaperOperation(); |
| 60 | 61 |
| 61 // Loads logged in user wallpaper asynchronously and sets to current wallpaper | |
| 62 // after loaded. | |
| 63 void SetLoggedInUserWallpaper(); | |
| 64 | |
| 65 // Sets the desktop background to solid color mode and creates a solid color | 62 // Sets the desktop background to solid color mode and creates a solid color |
| 66 // layout. | 63 // layout. |
| 67 void SetDesktopBackgroundSolidColorMode(); | 64 void SetDesktopBackgroundSolidColorMode(); |
| 68 | 65 |
| 69 private: | 66 private: |
| 70 // An operation to asynchronously loads wallpaper. | 67 // An operation to asynchronously loads wallpaper. |
| 71 class WallpaperOperation; | 68 class WallpaperOperation; |
| 72 | 69 |
| 73 // Sets the desktop background to image mode and creates a new background | 70 // Sets the desktop background to image mode and creates a new background |
| 74 // widget with user selected wallpaper or default wallpaper. Deletes the old | 71 // widget with user selected wallpaper or default wallpaper. Deletes the old |
| (...skipping 21 matching lines...) Expand all Loading... |
| 96 scoped_refptr<WallpaperOperation> wallpaper_op_; | 93 scoped_refptr<WallpaperOperation> wallpaper_op_; |
| 97 | 94 |
| 98 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; | 95 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; |
| 99 | 96 |
| 100 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); | 97 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); |
| 101 }; | 98 }; |
| 102 | 99 |
| 103 } // namespace ash | 100 } // namespace ash |
| 104 | 101 |
| 105 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ | 102 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
| OLD | NEW |