Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: ash/desktop_background/desktop_background_controller.h

Issue 110463004: ash: Fix DesktopBackgroundController getting stuck. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/display/display_controller.h" 9 #include "ash/display/display_controller.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // after loaded. Returns true if the controller started loading the 102 // after loaded. Returns true if the controller started loading the
103 // wallpaper and false otherwise (i.e. the appropriate wallpaper was 103 // wallpaper and false otherwise (i.e. the appropriate wallpaper was
104 // already loading or loaded). 104 // already loading or loaded).
105 bool SetDefaultWallpaper(bool is_guest); 105 bool SetDefaultWallpaper(bool is_guest);
106 106
107 // Sets the user selected custom wallpaper. Called when user selected a file 107 // Sets the user selected custom wallpaper. Called when user selected a file
108 // from file system or changed the layout of wallpaper. 108 // from file system or changed the layout of wallpaper.
109 void SetCustomWallpaper(const gfx::ImageSkia& image, WallpaperLayout layout); 109 void SetCustomWallpaper(const gfx::ImageSkia& image, WallpaperLayout layout);
110 110
111 // Cancels the current wallpaper loading operation. 111 // Cancels the current wallpaper loading operation.
112 void CancelPendingWallpaperOperation(); 112 void CancelDefaultWallpaperLoader();
DaveMoore 2013/12/26 21:00:35 Nit: Is the comment still correct?
Daniel Erat 2013/12/26 21:01:52 Yes, but I'll update it to be a bit clearer. (Only
113 113
114 // Creates an empty wallpaper. Some tests require a wallpaper widget is ready 114 // Creates an empty wallpaper. Some tests require a wallpaper widget is ready
115 // when running. However, the wallpaper widgets are now created asynchronously 115 // when running. However, the wallpaper widgets are now created asynchronously
116 // . If loading a real wallpaper, there are cases that these tests crash 116 // . If loading a real wallpaper, there are cases that these tests crash
117 // because the required widget is not ready. This function synchronously 117 // because the required widget is not ready. This function synchronously
118 // creates an empty widget for those tests to prevent crashes. An example test 118 // creates an empty widget for those tests to prevent crashes. An example test
119 // is SystemGestureEventFilterTest.ThreeFingerSwipe. 119 // is SystemGestureEventFilterTest.ThreeFingerSwipe.
120 void CreateEmptyWallpaper(); 120 void CreateEmptyWallpaper();
121 121
122 // Returns the appropriate wallpaper resolution for all root windows. 122 // Returns the appropriate wallpaper resolution for all root windows.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 scoped_ptr<WallpaperResizer> current_wallpaper_; 204 scoped_ptr<WallpaperResizer> current_wallpaper_;
205 205
206 // If a default wallpaper is stored in |current_wallpaper_|, the path and 206 // If a default wallpaper is stored in |current_wallpaper_|, the path and
207 // resource ID that were passed to WallpaperLoader when loading it. 207 // resource ID that were passed to WallpaperLoader when loading it.
208 // Otherwise, empty and -1, respectively. 208 // Otherwise, empty and -1, respectively.
209 base::FilePath current_default_wallpaper_path_; 209 base::FilePath current_default_wallpaper_path_;
210 int current_default_wallpaper_resource_id_; 210 int current_default_wallpaper_resource_id_;
211 211
212 gfx::Size current_max_display_size_; 212 gfx::Size current_max_display_size_;
213 213
214 scoped_refptr<WallpaperLoader> wallpaper_loader_; 214 // Loads default wallpaper from disk.
215 scoped_refptr<WallpaperLoader> default_wallpaper_loader_;
215 216
216 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; 217 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_;
217 218
218 base::OneShotTimer<DesktopBackgroundController> timer_; 219 base::OneShotTimer<DesktopBackgroundController> timer_;
219 220
220 int wallpaper_reload_delay_; 221 int wallpaper_reload_delay_;
221 222
222 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); 223 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController);
223 }; 224 };
224 225
225 } // namespace ash 226 } // namespace ash
226 227
227 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ 228 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698