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

Unified Diff: ash/desktop_background/desktop_background_controller.h

Issue 208273005: If customization includes default wallpaper, download and apply it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deleted DBC::SetDefaultWallpaper. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ash/desktop_background/desktop_background_controller.h
diff --git a/ash/desktop_background/desktop_background_controller.h b/ash/desktop_background/desktop_background_controller.h
index 505f7441792b86584a009f06becf2453195119f0..39d83dd50e3e489fd40865efeed194b4171b24b1 100644
--- a/ash/desktop_background/desktop_background_controller.h
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -23,10 +23,6 @@ namespace aura {
class Window;
}
-namespace base {
-class CommandLine;
-}
-
namespace ash {
enum WallpaperLayout {
@@ -83,10 +79,6 @@ class ASH_EXPORT DesktopBackgroundController
return desktop_background_mode_;
}
- void set_command_line_for_testing(base::CommandLine* command_line) {
- command_line_for_testing_ = command_line;
- }
-
// Add/Remove observers.
void AddObserver(DesktopBackgroundControllerObserver* observer);
void RemoveObserver(DesktopBackgroundControllerObserver* observer);
@@ -100,19 +92,10 @@ class ASH_EXPORT DesktopBackgroundController
// Initialize root window's background.
void OnRootWindowAdded(aura::Window* root_window);
- // Loads builtin wallpaper asynchronously and sets to current wallpaper
- // after loaded. Returns true if the controller started loading the
- // wallpaper and false otherwise (i.e. the appropriate wallpaper was
- // already loading or loaded).
- bool SetDefaultWallpaper(bool is_guest);
-
// Sets the user selected custom wallpaper. Called when user selected a file
Daniel Erat 2014/03/27 01:45:50 update this comment if it's no longer only used fo
Alexander Alekseev 2014/03/31 14:15:40 Done.
// from file system or changed the layout of wallpaper.
void SetCustomWallpaper(const gfx::ImageSkia& image, WallpaperLayout layout);
Daniel Erat 2014/03/27 01:45:50 rename this to SetWallpaper()
Alexander Alekseev 2014/03/31 14:15:40 Done.
- // Cancels |default_wallpaper_loader_| if non-NULL.
- void CancelDefaultWallpaperLoader();
-
// Creates an empty wallpaper. Some tests require a wallpaper widget is ready
// when running. However, the wallpaper widgets are now created
// asynchronously. If loading a real wallpaper, there are cases that these
@@ -135,6 +118,10 @@ class ASH_EXPORT DesktopBackgroundController
// Overrides DisplayController::Observer:
virtual void OnDisplayConfigurationChanged() OVERRIDE;
+ // Returns true if the specified custom wallpaper is already stored
+ // in |current_wallpaper_|.
+ bool CustomWallpaperIsAlreadyLoaded(const gfx::ImageSkia& image) const;
+
private:
friend class DesktopBackgroundControllerTest;
FRIEND_TEST_ALL_PREFIXES(DesktopBackgroundControllerTest, GetMaxDisplaySize);
@@ -142,23 +129,10 @@ class ASH_EXPORT DesktopBackgroundController
// An operation to asynchronously loads wallpaper.
class WallpaperLoader;
- // Returns true if the specified default wallpaper is already being
- // loaded by |wallpaper_loader_| or stored in |current_wallpaper_|.
- bool DefaultWallpaperIsAlreadyLoadingOrLoaded(
- const base::FilePath& image_file, int image_resource_id) const;
-
- // Returns true if the specified custom wallpaper is already stored
- // in |current_wallpaper_|.
- bool CustomWallpaperIsAlreadyLoaded(const gfx::ImageSkia& image) const;
-
// Creates view for all root windows, or notifies them to repaint if they
// already exist.
void SetDesktopBackgroundImageMode();
- // Creates a new background widget and sets the background mode to image mode.
- // Called after a default wallpaper has been loaded successfully.
- void OnDefaultWallpaperLoadCompleted(scoped_refptr<WallpaperLoader> loader);
-
// Creates and adds component for current mode (either Widget or Layer) to
// |root_window|.
void InstallDesktopController(aura::Window* root_window);
@@ -190,9 +164,6 @@ class ASH_EXPORT DesktopBackgroundController
// maximum width of all displays, and the maximum height of all displays.
static gfx::Size GetMaxDisplaySizeInNative();
- // If non-NULL, used in place of the real command line.
- base::CommandLine* command_line_for_testing_;
-
// Can change at runtime.
bool locked_;
@@ -205,19 +176,8 @@ class ASH_EXPORT DesktopBackgroundController
// The current wallpaper.
scoped_ptr<WallpaperResizer> current_wallpaper_;
- // If a default wallpaper is stored in |current_wallpaper_|, the path and
- // resource ID that were passed to WallpaperLoader when loading it.
- // Otherwise, empty and -1, respectively.
- base::FilePath current_default_wallpaper_path_;
- int current_default_wallpaper_resource_id_;
-
gfx::Size current_max_display_size_;
- // Loads default wallpaper from disk.
- scoped_refptr<WallpaperLoader> default_wallpaper_loader_;
-
- base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_;
-
base::OneShotTimer<DesktopBackgroundController> timer_;
int wallpaper_reload_delay_;

Powered by Google App Engine
This is Rietveld 408576698