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 "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 void SetDesktopBackgroundSolidColorMode(SkColor color); | 83 void SetDesktopBackgroundSolidColorMode(SkColor color); |
84 | 84 |
85 // Creates an empty wallpaper. Some tests require a wallpaper widget is ready | 85 // Creates an empty wallpaper. Some tests require a wallpaper widget is ready |
86 // when running. However, the wallpaper widgets are now created asynchronously | 86 // when running. However, the wallpaper widgets are now created asynchronously |
87 // . If loading a real wallpaper, there are cases that these tests crash | 87 // . If loading a real wallpaper, there are cases that these tests crash |
88 // because the required widget is not ready. This function synchronously | 88 // because the required widget is not ready. This function synchronously |
89 // creates an empty widget for those tests to prevent crashes. An example test | 89 // creates an empty widget for those tests to prevent crashes. An example test |
90 // is SystemGestureEventFilterTest.ThreeFingerSwipe. | 90 // is SystemGestureEventFilterTest.ThreeFingerSwipe. |
91 void CreateEmptyWallpaper(); | 91 void CreateEmptyWallpaper(); |
92 | 92 |
93 // Create desktop views on Lock Screen layer. | |
94 void CreateLockScreenDesktops(); | |
95 | |
96 // Remove all desktop views on Lock Screen layer created by | |
97 // CreateLockScreenDesktops. | |
98 void RemoveLockScreenDesktops(); | |
99 | |
93 private: | 100 private: |
94 // An operation to asynchronously loads wallpaper. | 101 // An operation to asynchronously loads wallpaper. |
95 class WallpaperOperation; | 102 class WallpaperOperation; |
96 | 103 |
97 struct WallpaperData; | 104 struct WallpaperData; |
98 | 105 |
99 // Creates a new background widget using the current wallpapaer image and | 106 // Creates a new background widget using the current wallpapaer image and |
100 // use it as a background of the |root_window|. Deletes the old widget if any. | 107 // use it as a background of the |root_window|. Deletes the old widget if any. |
101 void SetDesktopBackgroundImage(aura::RootWindow* root_window); | 108 void SetDesktopBackgroundImage(aura::RootWindow* root_window); |
102 | 109 |
103 // Update the background of all root windows using the current wallpaper image | 110 // Update the background of all root windows using the current wallpaper image |
104 // in |current_wallpaper_|. | 111 // in |current_wallpaper_|. |
105 void UpdateDesktopBackgroundImageMode(); | 112 void UpdateDesktopBackgroundImageMode(); |
106 | 113 |
107 // Creates a new background widget and sets the background mode to image mode. | 114 // Creates a new background widget and sets the background mode to image mode. |
108 // Called after wallpaper loaded successfully. | 115 // Called after wallpaper loaded successfully. |
109 void OnWallpaperLoadCompleted(scoped_refptr<WallpaperOperation> wo); | 116 void OnWallpaperLoadCompleted(scoped_refptr<WallpaperOperation> wo); |
110 | 117 |
118 // Add layer with solid |color| to container |container_id| in |root_window| | |
119 void SetColorLayerForContainer(SkColor color, | |
120 aura::RootWindow* root_window, | |
121 int container_id); | |
bshe
2012/07/23 00:19:36
Nit: Could you make the last two argument align wi
Denis Kuznetsov (DE-MUC)
2012/07/23 14:01:09
Done.
| |
122 | |
111 // Can change at runtime. | 123 // Can change at runtime. |
112 BackgroundMode desktop_background_mode_; | 124 BackgroundMode desktop_background_mode_; |
113 | 125 |
114 SkColor background_color_; | 126 SkColor background_color_; |
115 | 127 |
116 // The current wallpaper. | 128 // The current wallpaper. |
117 scoped_ptr<WallpaperData> current_wallpaper_; | 129 scoped_ptr<WallpaperData> current_wallpaper_; |
118 | 130 |
119 scoped_refptr<WallpaperOperation> wallpaper_op_; | 131 scoped_refptr<WallpaperOperation> wallpaper_op_; |
120 | 132 |
121 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; | 133 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; |
122 | 134 |
123 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); | 135 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); |
124 }; | 136 }; |
125 | 137 |
126 } // namespace ash | 138 } // namespace ash |
127 | 139 |
128 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ | 140 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
OLD | NEW |