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

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: Moved all wallpaper paths from DBC to WallpaperManager. 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..7938106351e41b0a816b8282fb81a520f24ab2ed 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);
@@ -104,7 +96,8 @@ class ASH_EXPORT DesktopBackgroundController
// 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);
+ bool SetDefaultWallpaper(const base::FilePath& small_resolution_path,
+ const base::FilePath& large_resolution_path);
// Sets the user selected custom wallpaper. Called when user selected a file
// from file system or changed the layout of wallpaper.
@@ -135,6 +128,13 @@ class ASH_EXPORT DesktopBackgroundController
// Overrides DisplayController::Observer:
virtual void OnDisplayConfigurationChanged() OVERRIDE;
+ // Returns true if the specified default wallpaper file is already being
+ // loaded by |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;
+
private:
friend class DesktopBackgroundControllerTest;
FRIEND_TEST_ALL_PREFIXES(DesktopBackgroundControllerTest, GetMaxDisplaySize);
@@ -144,6 +144,7 @@ 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 exactly duplicate request received)
bool DefaultWallpaperIsAlreadyLoadingOrLoaded(
const base::FilePath& image_file, int image_resource_id) const;
@@ -190,9 +191,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_;

Powered by Google App Engine
This is Rietveld 408576698