| 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" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // . If loading a real wallpaper, there are cases that these tests crash | 113 // . If loading a real wallpaper, there are cases that these tests crash |
| 114 // because the required widget is not ready. This function synchronously | 114 // because the required widget is not ready. This function synchronously |
| 115 // creates an empty widget for those tests to prevent crashes. An example test | 115 // creates an empty widget for those tests to prevent crashes. An example test |
| 116 // is SystemGestureEventFilterTest.ThreeFingerSwipe. | 116 // is SystemGestureEventFilterTest.ThreeFingerSwipe. |
| 117 void CreateEmptyWallpaper(); | 117 void CreateEmptyWallpaper(); |
| 118 | 118 |
| 119 // Returns the appropriate wallpaper resolution for all root windows. | 119 // Returns the appropriate wallpaper resolution for all root windows. |
| 120 WallpaperResolution GetAppropriateResolution(); | 120 WallpaperResolution GetAppropriateResolution(); |
| 121 | 121 |
| 122 // Move all desktop widgets to locked container. | 122 // Move all desktop widgets to locked container. |
| 123 void MoveDesktopToLockedContainer(); | 123 // Returns true if the desktop moved. |
| 124 bool MoveDesktopToLockedContainer(); |
| 124 | 125 |
| 125 // Move all desktop widgets to unlocked container. | 126 // Move all desktop widgets to unlocked container. |
| 126 void MoveDesktopToUnlockedContainer(); | 127 // Returns true if the desktop moved. |
| 128 bool MoveDesktopToUnlockedContainer(); |
| 127 | 129 |
| 128 // WindowObserver implementation. | 130 // WindowObserver implementation. |
| 129 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 131 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
| 130 | 132 |
| 131 private: | 133 private: |
| 132 // An operation to asynchronously loads wallpaper. | 134 // An operation to asynchronously loads wallpaper. |
| 133 class WallpaperOperation; | 135 class WallpaperOperation; |
| 134 | 136 |
| 135 struct WallpaperData; | 137 struct WallpaperData; |
| 136 | 138 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 148 int container_id); | 150 int container_id); |
| 149 | 151 |
| 150 // Creates and adds component for current mode (either Widget or Layer) to | 152 // Creates and adds component for current mode (either Widget or Layer) to |
| 151 // |root_window|. | 153 // |root_window|. |
| 152 void InstallComponent(aura::RootWindow* root_window); | 154 void InstallComponent(aura::RootWindow* root_window); |
| 153 | 155 |
| 154 // Creates and adds component for current mode (either Widget or Layer) to | 156 // Creates and adds component for current mode (either Widget or Layer) to |
| 155 // all root windows. | 157 // all root windows. |
| 156 void InstallComponentForAllWindows(); | 158 void InstallComponentForAllWindows(); |
| 157 | 159 |
| 158 // Moves all descktop components from one container to other across all root | 160 // Moves all desktop components from one container to other across all root |
| 159 // windows. | 161 // windows. Returns true if a desktop moved. |
| 160 void ReparentBackgroundWidgets(int src_container, int dst_container); | 162 bool ReparentBackgroundWidgets(int src_container, int dst_container); |
| 161 | 163 |
| 162 // Returns id for background container for unlocked and locked states. | 164 // Returns id for background container for unlocked and locked states. |
| 163 int GetBackgroundContainerId(bool locked); | 165 int GetBackgroundContainerId(bool locked); |
| 164 | 166 |
| 165 // Send notification that background animation finished. | 167 // Send notification that background animation finished. |
| 166 void NotifyAnimationFinished(); | 168 void NotifyAnimationFinished(); |
| 167 | 169 |
| 168 // Can change at runtime. | 170 // Can change at runtime. |
| 169 bool locked_; | 171 bool locked_; |
| 170 | 172 |
| 171 BackgroundMode desktop_background_mode_; | 173 BackgroundMode desktop_background_mode_; |
| 172 | 174 |
| 173 SkColor background_color_; | 175 SkColor background_color_; |
| 174 | 176 |
| 175 // The current wallpaper. | 177 // The current wallpaper. |
| 176 scoped_ptr<WallpaperData> current_wallpaper_; | 178 scoped_ptr<WallpaperData> current_wallpaper_; |
| 177 | 179 |
| 178 scoped_refptr<WallpaperOperation> wallpaper_op_; | 180 scoped_refptr<WallpaperOperation> wallpaper_op_; |
| 179 | 181 |
| 180 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; | 182 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; |
| 181 | 183 |
| 182 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); | 184 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); |
| 183 }; | 185 }; |
| 184 | 186 |
| 185 } // namespace ash | 187 } // namespace ash |
| 186 | 188 |
| 187 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ | 189 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
| OLD | NEW |