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

Unified Diff: ash/desktop_background/desktop_background_controller.cc

Issue 11016030: cros: Fix missing windows/launcher after resume/screen unlock (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/screen_locker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4d084df5dbd47cec917fdbda768d0026c9d9d7b5..ae22b55e521e94c66ba3f247e24fad3e46d6b210 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -23,6 +23,10 @@
#include "ui/gfx/image/image.h"
#include "ui/views/widget/widget.h"
+using ash::internal::DesktopBackgroundWidgetController;
+using ash::internal::kComponentWrapper;
+using ash::internal::kWindowDesktopComponent;
+
namespace ash {
namespace {
@@ -345,17 +349,25 @@ bool DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
for (Shell::RootWindowList::iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter) {
aura::RootWindow* root_window = *iter;
- if (root_window->GetProperty(internal::kComponentWrapper)) {
- internal::DesktopBackgroundWidgetController* component = root_window->
- GetProperty(internal::kWindowDesktopComponent);
- // Wallpaper animation may not finish at this point. Try to get component
- // from kComponentWrapper instead.
- if (!component) {
- component = root_window->GetProperty(internal::kComponentWrapper)->
- GetComponent(false);
- }
- DCHECK(component);
- moved = moved || component->Reparent(root_window,
+ // In the steady state (no animation playing) the background widget
+ // controller exists in the kWindowDesktopComponent property.
+ DesktopBackgroundWidgetController* desktop_component = root_window->
+ GetProperty(kWindowDesktopComponent);
+ if (desktop_component) {
+ moved |= desktop_component->Reparent(root_window,
+ src_container,
+ dst_container);
+ }
+ // During desktop show animations the controller lives in kComponentWrapper.
+ // NOTE: If a wallpaper load happens during a desktop show animation there
+ // can temporarily be two desktop background widgets. We must reparent
+ // both of them - one above and one here.
+ DesktopBackgroundWidgetController* wrapped_component =
+ root_window->GetProperty(kComponentWrapper) ?
+ root_window->GetProperty(kComponentWrapper)->GetComponent(false) :
+ NULL;
+ if (wrapped_component) {
+ moved |= wrapped_component->Reparent(root_window,
src_container,
dst_container);
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/screen_locker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698