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

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: Use event targeter to block keyboard and mouse events. 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 730558696d93d2ce82e7a7dcb78b172c32d568d2..8cb0128178d32f0199a9b867c2f58cd5f5ccd392 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -161,11 +161,13 @@ DesktopBackgroundController::DesktopBackgroundController()
weak_ptr_factory_(this),
wallpaper_reload_delay_(kWallpaperReloadDelayMs) {
Shell::GetInstance()->display_controller()->AddObserver(this);
+ Shell::GetInstance()->AddShellObserver(this);
}
DesktopBackgroundController::~DesktopBackgroundController() {
CancelDefaultWallpaperLoader();
Shell::GetInstance()->display_controller()->RemoveObserver(this);
+ Shell::GetInstance()->RemoveShellObserver(this);
}
gfx::ImageSkia DesktopBackgroundController::GetWallpaper() const {
@@ -190,23 +192,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::SetDefaultWallpaper(bool is_guest) {
VLOG(1) << "SetDefaultWallpaper: is_guest=" << is_guest;
const bool use_large =
@@ -327,6 +312,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);
+}
+
bool DesktopBackgroundController::DefaultWallpaperIsAlreadyLoadingOrLoaded(
const base::FilePath& image_file,
int image_resource_id) const {

Powered by Google App Engine
This is Rietveld 408576698