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

Unified Diff: ash/desktop_background/desktop_background_widget_controller.h

Issue 10827284: Fix white flash when user sings out and wallpaper animation regression (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sky's review Created 8 years, 4 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_widget_controller.h
diff --git a/ash/desktop_background/desktop_background_widget_controller.h b/ash/desktop_background/desktop_background_widget_controller.h
index fe07ef30430b656ed0ad7f90537e09f5de62b491..a43db147111637799c24df73bc4f8ed06a51f569 100644
--- a/ash/desktop_background/desktop_background_widget_controller.h
+++ b/ash/desktop_background/desktop_background_widget_controller.h
@@ -21,6 +21,12 @@ class DesktopBackgroundWidgetController {
explicit DesktopBackgroundWidgetController(views::Widget* widget);
explicit DesktopBackgroundWidgetController(ui::Layer* layer);
+ // When set kWindowDesktopComponent property from root window, this
+ // desctructor is called. It immediately remove the widget or layer it
sky 2012/08/13 17:31:05 Move this to the class level. Also, its rather con
bshe 2012/08/13 18:28:22 Done.
+ // contains. On wallpaper change, if set property is called immediately after
+ // a new component is created. The old widget or layer will removed
+ // immediately. And a white screen will show. The new wallpaper will fade in
+ // from the white screen, which gives white flash from users' perspective.
~DesktopBackgroundWidgetController();
// Set bounds of component that draws background.
@@ -43,11 +49,32 @@ class DesktopBackgroundWidgetController {
DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundWidgetController);
};
+// This class wrappes a DesktopBackgroundWidgetController pointer. It is used to
sky 2012/08/13 17:31:05 wraps
bshe 2012/08/13 18:28:22 Done.
+// save the pointer on kComponentWrapper property during the time
+// DesktopBackgroundWidgetController initialized and wallpaper animation
+// finished. After animation finished, the pointer in this class is set as
+// kWindowDesktopComponent property. If we set the pointer immediately after it
+// is created, a white flash will appear when changing wallpaper as described
+// in the comment for ~DesktopBackgroundWidgetController.
+class ComponentWrapper {
+ public:
+ explicit ComponentWrapper(
+ DesktopBackgroundWidgetController* component);
+ ~ComponentWrapper() {}
+ DesktopBackgroundWidgetController* component() { return component_; }
+
+ private:
+ DesktopBackgroundWidgetController* component_;
+ DISALLOW_COPY_AND_ASSIGN(ComponentWrapper);
sky 2012/08/13 17:31:05 nit: newline between 67/68.
bshe 2012/08/13 18:28:22 Done.
+};
+
// Window property key, that binds instance of DesktopBackgroundWidgetController
// to root windows.
extern const aura::WindowProperty<DesktopBackgroundWidgetController*>* const
kWindowDesktopComponent;
+extern const aura::WindowProperty<ComponentWrapper*>* const kComponentWrapper;
+
} // namespace internal
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698