OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
| 6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "ash/ash_export.h" |
| 10 #include "base/basictypes.h" |
| 11 |
| 12 class SkBitmap; |
| 13 |
| 14 namespace ash { |
| 15 |
| 16 // A class to listen for login and desktop background change events and set the |
| 17 // corresponding default wallpaper in Aura shell. |
| 18 class ASH_EXPORT DesktopBackgroundController { |
| 19 public: |
| 20 enum BackgroundMode { |
| 21 BACKGROUND_IMAGE, |
| 22 BACKGROUND_SOLID_COLOR |
| 23 }; |
| 24 |
| 25 DesktopBackgroundController(); |
| 26 virtual ~DesktopBackgroundController(); |
| 27 |
| 28 // Get the desktop background mode. |
| 29 BackgroundMode desktop_background_mode() const { |
| 30 return desktop_background_mode_; |
| 31 } |
| 32 |
| 33 // Change the desktop background image to wallpaper with |index|. |
| 34 void OnDesktopBackgroundChanged(int index); |
| 35 |
| 36 // Sets the desktop background to image mode and create a new background |
| 37 // widget with |wallpaper|. |
| 38 void SetDesktopBackgroundImageMode(const SkBitmap& wallpaper); |
| 39 |
| 40 // Sets the desktop background to image mode and create a new background |
| 41 // widget with default wallpaper. |
| 42 void SetDefaultDesktopBackgroundImage(); |
| 43 |
| 44 // Sets the desktop background to image mode and create a new background |
| 45 // widget with previous selected wallpaper at run time. |
| 46 void SetPreviousDesktopBackgroundImage(); |
| 47 |
| 48 // Sets the desktop background to solid color mode and create a solid color |
| 49 // layout. |
| 50 void SetDesktopBackgroundSolidColorMode(); |
| 51 |
| 52 private: |
| 53 // We need to cache the previously used wallpaper index. So when users switch |
| 54 // desktop background color mode at run time, we can directly switch back to |
| 55 // the user selected wallpaper in image mode. |
| 56 int previous_wallpaper_index_; |
| 57 |
| 58 // Can change at runtime. |
| 59 BackgroundMode desktop_background_mode_; |
| 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); |
| 62 }; |
| 63 |
| 64 } // namespace ash |
| 65 |
| 66 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
OLD | NEW |