Chromium Code Reviews| 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 |