summaryrefslogtreecommitdiffstats
path: root/ash/desktop_background
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-26 19:10:07 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-26 19:10:07 +0000
commit3d0b95dad45e5ddf3fd23d68647144fa585798a9 (patch)
tree79e68d4f41366cfe899d580f3578e416f76370c5 /ash/desktop_background
parentb5d500779e947e5c51ff813f2df9e4ab3c768cf5 (diff)
downloadchromium_src-3d0b95dad45e5ddf3fd23d68647144fa585798a9.zip
chromium_src-3d0b95dad45e5ddf3fd23d68647144fa585798a9.tar.gz
chromium_src-3d0b95dad45e5ddf3fd23d68647144fa585798a9.tar.bz2
cros: Add CHECK for screen unlock problem
On some devices when you unlock the screen after suspend the launcher and desktop windows do not appear. I suspect the background widget is not being reparented properly but I cannot reproduce the problem internally. Since the user can't recover from this state without rebooting, add some CHECKs to try to track down the source. Also initialize empty wallpaper if we're running tests, as we previously skipped it which would cause my CHECKs to be hit. BUG=149043 TEST=ScreenLockerTest and manual, lock screen with Ctrl-Shift-L, unlock by entering password Review URL: https://chromiumcodereview.appspot.com/10982035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158846 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background')
-rw-r--r--ash/desktop_background/desktop_background_controller.cc8
-rw-r--r--ash/desktop_background/desktop_background_widget_controller.cc4
2 files changed, 12 insertions, 0 deletions
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
index cb186ad..51bb338 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -347,6 +347,7 @@ void DesktopBackgroundController::InstallComponentForAllWindows() {
void DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
int dst_container) {
+ bool reparented = false;
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
for (Shell::RootWindowList::iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter) {
@@ -364,8 +365,15 @@ void DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
component->Reparent(root_window,
src_container,
dst_container);
+ reparented = true;
}
}
+ // If we didn't reparent the desktop background then either the screen is
+ // unlocked and the user's windows are hidden, or the screen is locked and
+ // the user's windows are visible. Either case is bad, and the first case
+ // is happening in the field. Check if this location is the cause.
+ // See crbug.com/149043
+ CHECK(reparented);
}
int DesktopBackgroundController::GetBackgroundContainerId(bool locked) {
diff --git a/ash/desktop_background/desktop_background_widget_controller.cc b/ash/desktop_background/desktop_background_widget_controller.cc
index 8ee45ed..408859f 100644
--- a/ash/desktop_background/desktop_background_widget_controller.cc
+++ b/ash/desktop_background/desktop_background_widget_controller.cc
@@ -48,6 +48,10 @@ void DesktopBackgroundWidgetController::SetBounds(gfx::Rect bounds) {
void DesktopBackgroundWidgetController::Reparent(aura::RootWindow* root_window,
int src_container,
int dest_container) {
+ // Ensure that something will be reparented. Otherwise we might get into a
+ // state where the screen is unlocked but the user's windows and launcher
+ // are still hidden. See crbug.com/149043
+ CHECK(widget_ || layer_.get());
if (widget_) {
views::Widget::ReparentNativeView(widget_->GetNativeView(),
root_window->GetChildById(dest_container));