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

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: 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..7111268b407a406b0fd06901d213960e54c8c954 100644
--- a/ash/desktop_background/desktop_background_controller.h
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -135,6 +135,11 @@ class ASH_EXPORT DesktopBackgroundController
// Overrides DisplayController::Observer:
virtual void OnDisplayConfigurationChanged() OVERRIDE;
+ // Use given files as default wallpaper.
+ void SetDefaultWallpaperPath(
Daniel Erat 2014/03/24 16:25:48 nit: move this above the overridden method (also i
Alexander Alekseev 2014/03/24 17:33:43 Done.
+ const base::FilePath& customized_default_wallpaper_file_small,
Daniel Erat 2014/03/24 16:25:48 nit: mind removing the word "customized" from thes
Alexander Alekseev 2014/03/24 17:33:43 Done.
+ const base::FilePath& customized_default_wallpaper_file_large);
+
private:
friend class DesktopBackgroundControllerTest;
FRIEND_TEST_ALL_PREFIXES(DesktopBackgroundControllerTest, GetMaxDisplaySize);
@@ -144,9 +149,17 @@ class ASH_EXPORT DesktopBackgroundController
// Returns true if the specified default wallpaper is already being
// loaded by |wallpaper_loader_| or stored in |current_wallpaper_|.
+ // (i.e. no need to reload if exacltly duplicate request received)
Daniel Erat 2014/03/24 16:25:48 nit: s/exacltly/exactly/
Alexander Alekseev 2014/03/24 17:33:43 Done.
bool DefaultWallpaperIsAlreadyLoadingOrLoaded(
const base::FilePath& image_file, int image_resource_id) const;
+ // Returns true if the specified default wallpaper file is already being
+ // loaded |wallpaper_loader_| or stored in |current_wallpaper_|.
+ // (i.e. if current wallpaper is "default" and we need to replace the default
+ // wallpaper with another file, we need to initiate SetDefaultWallpaper() )
+ bool DefaultWallpaperFileIsAlreadyLoadingOrLoaded(
+ const base::FilePath& image_file) const;
+
// Returns true if the specified custom wallpaper is already stored
// in |current_wallpaper_|.
bool CustomWallpaperIsAlreadyLoaded(const gfx::ImageSkia& image) const;
@@ -190,6 +203,14 @@ class ASH_EXPORT DesktopBackgroundController
// maximum width of all displays, and the maximum height of all displays.
static gfx::Size GetMaxDisplaySizeInNative();
+ // SetDefaultWallpaper using given path and mode.
+ bool DoSetDefaultWallpaper(const base::FilePath& file_path,
+ const bool use_large);
+
+ // Before setting first wallpaper we need to check and probably apply
+ // device customization.
+ void CheckForCustomization();
+
// If non-NULL, used in place of the real command line.
base::CommandLine* command_line_for_testing_;
@@ -222,6 +243,11 @@ class ASH_EXPORT DesktopBackgroundController
int wallpaper_reload_delay_;
+ base::FilePath customized_default_wallpaper_file_small_;
+ base::FilePath customized_default_wallpaper_file_large_;
+
+ bool customization_applied_;
+
DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController);
};

Powered by Google App Engine
This is Rietveld 408576698