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

Unified Diff: ash/desktop_background/desktop_background_controller.cc

Issue 230613004: Block keyboard and mouse input when maximize mode is activated by accelerometer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master. Created 6 years, 8 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.cc
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
index bada38371e7d24c52bdf292121dc56793af23acb..8b54cb5b295ca7155edd9c679965b07114d6a07a 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -48,10 +48,12 @@ DesktopBackgroundController::DesktopBackgroundController()
desktop_background_mode_(BACKGROUND_NONE),
wallpaper_reload_delay_(kWallpaperReloadDelayMs) {
Shell::GetInstance()->display_controller()->AddObserver(this);
+ Shell::GetInstance()->AddShellObserver(this);
}
DesktopBackgroundController::~DesktopBackgroundController() {
Shell::GetInstance()->display_controller()->RemoveObserver(this);
+ Shell::GetInstance()->RemoveShellObserver(this);
}
gfx::ImageSkia DesktopBackgroundController::GetWallpaper() const {
@@ -76,23 +78,6 @@ WallpaperLayout DesktopBackgroundController::GetWallpaperLayout() const {
return WALLPAPER_LAYOUT_CENTER_CROPPED;
}
-void DesktopBackgroundController::OnRootWindowAdded(aura::Window* root_window) {
- // The background hasn't been set yet.
- if (desktop_background_mode_ == BACKGROUND_NONE)
- return;
-
- // Handle resolution change for "built-in" images.
- gfx::Size max_display_size = GetMaxDisplaySizeInNative();
- if (current_max_display_size_ != max_display_size) {
- current_max_display_size_ = max_display_size;
- if (desktop_background_mode_ == BACKGROUND_IMAGE &&
- current_wallpaper_.get())
- UpdateWallpaper();
- }
-
- InstallDesktopController(root_window);
-}
-
bool DesktopBackgroundController::SetWallpaperImage(const gfx::ImageSkia& image,
WallpaperLayout layout) {
VLOG(1) << "SetWallpaper: image_id=" << WallpaperResizer::GetImageId(image)
@@ -169,6 +154,23 @@ void DesktopBackgroundController::OnDisplayConfigurationChanged() {
}
}
+void DesktopBackgroundController::OnRootWindowAdded(aura::Window* root_window) {
+ // The background hasn't been set yet.
+ if (desktop_background_mode_ == BACKGROUND_NONE)
+ return;
+
+ // Handle resolution change for "built-in" images.
+ gfx::Size max_display_size = GetMaxDisplaySizeInNative();
+ if (current_max_display_size_ != max_display_size) {
+ current_max_display_size_ = max_display_size;
+ if (desktop_background_mode_ == BACKGROUND_IMAGE &&
+ current_wallpaper_.get())
+ UpdateWallpaper();
+ }
+
+ InstallDesktopController(root_window);
+}
+
// static
gfx::Size DesktopBackgroundController::GetMaxDisplaySizeInNative() {
int width = 0;
« no previous file with comments | « ash/desktop_background/desktop_background_controller.h ('k') | ash/high_contrast/high_contrast_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698