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

Unified Diff: ash/desktop_background/desktop_background_controller.h

Issue 210313004: ABANDONED: ash: Support changing default wallpaper at runtime. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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..55b81c5b106c78cb97b7359440f0d4d1e39c9acb 100644
--- a/ash/desktop_background/desktop_background_controller.h
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -83,10 +83,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,6 +96,20 @@ class ASH_EXPORT DesktopBackgroundController
// Initialize root window's background.
void OnRootWindowAdded(aura::Window* root_window);
+ // Initializes |small_default_wallpaper_path_|,
+ // |large_default_wallpaper_path_|, |small_guest_wallpaper_path_|, and
+ // |large_guest_wallpaper_path_| based on the flags in |cl|.
+ // Called from the c'tor with the current process's command line, but also
+ // made public so that tests can call it with a custom command line.
+ void InitWallpaperPathsFromCommandLine(base::CommandLine* cl);
+
+ // Overrides command-line arguments specifying the default wallpaper.
+ // If the previous default wallpaper is currently being shown, the new default
+ // wallpaper is loaded instead.
+ void SetDefaultWallpaperPaths(const base::FilePath& small_path,
+ const base::FilePath& large_path,
+ bool is_guest);
+
// 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
@@ -142,10 +152,19 @@ class ASH_EXPORT DesktopBackgroundController
// An operation to asynchronously loads wallpaper.
class WallpaperLoader;
+ // Determines information about the default wallpaper that should currently be
+ // used. Out-param pointers may be NULL, in which case they will be ignored.
+ void GetDefaultWallpaperInfo(bool is_guest,
+ base::FilePath* file_path,
+ WallpaperLayout* file_layout,
+ int* resource_id,
+ WallpaperLayout* resource_layout);
+
// 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;
+ const base::FilePath& image_file,
+ int image_resource_id) const;
// Returns true if the specified custom wallpaper is already stored
// in |current_wallpaper_|.
@@ -180,8 +199,8 @@ class ASH_EXPORT DesktopBackgroundController
// Reload the wallpaper.
void UpdateWallpaper();
- void set_wallpaper_reload_delay_for_test(bool value) {
- wallpaper_reload_delay_ = value;
+ void set_wallpaper_reload_delay_for_test(base::TimeDelta delay) {
+ wallpaper_reload_delay_ = delay;
}
// Returns the maximum size of all displays combined in native
@@ -190,12 +209,15 @@ 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_;
+ // Wallpaper images loaded by SetDefaultWallpaper().
+ base::FilePath small_default_wallpaper_path_;
+ base::FilePath large_default_wallpaper_path_;
+ base::FilePath small_guest_wallpaper_path_;
+ base::FilePath large_guest_wallpaper_path_;
+
BackgroundMode desktop_background_mode_;
SkColor background_color_;
@@ -220,7 +242,8 @@ class ASH_EXPORT DesktopBackgroundController
base::OneShotTimer<DesktopBackgroundController> timer_;
- int wallpaper_reload_delay_;
+ // Delay before updating the wallpaper when the display configuration changes.
+ base::TimeDelta wallpaper_reload_delay_;
DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController);
};

Powered by Google App Engine
This is Rietveld 408576698