OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_WIDGET_CONTROLLER_H_ | 5 #ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_WIDGET_CONTROLLER_H_ |
6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_WIDGET_CONTROLLER_H_ | 6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_WIDGET_CONTROLLER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/aura/window_property.h" | 9 #include "ui/aura/window_property.h" |
10 #include "ui/compositor/layer.h" | 10 #include "ui/compositor/layer.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // This class wraps a DesktopBackgroundWidgetController pointer. It is installed | 51 // This class wraps a DesktopBackgroundWidgetController pointer. It is installed |
52 // as an owned property on the RootWindow. DesktopBackgroundWidgetController is | 52 // as an owned property on the RootWindow. DesktopBackgroundWidgetController is |
53 // moved to this property before animation completes. After animation completes, | 53 // moved to this property before animation completes. After animation completes, |
54 // the kWindowDesktopComponent property on RootWindow is set to the | 54 // the kWindowDesktopComponent property on RootWindow is set to the |
55 // DesktopBackgroundWidgetController in this class. | 55 // DesktopBackgroundWidgetController in this class. |
56 class ComponentWrapper { | 56 class ComponentWrapper { |
57 public: | 57 public: |
58 explicit ComponentWrapper( | 58 explicit ComponentWrapper( |
59 DesktopBackgroundWidgetController* component); | 59 DesktopBackgroundWidgetController* component); |
60 ~ComponentWrapper() {} | 60 ~ComponentWrapper() {} |
61 DesktopBackgroundWidgetController* component() { return component_; } | 61 |
| 62 // Gets the wrapped DesktopBackgroundWidgetController pointer. Caller should |
| 63 // take ownership of the pointer if |pass_ownership| is true. |
| 64 DesktopBackgroundWidgetController* GetComponent(bool pass_ownership); |
62 | 65 |
63 private: | 66 private: |
64 DesktopBackgroundWidgetController* component_; | 67 scoped_ptr<DesktopBackgroundWidgetController> component_; |
65 | 68 |
66 DISALLOW_COPY_AND_ASSIGN(ComponentWrapper); | 69 DISALLOW_COPY_AND_ASSIGN(ComponentWrapper); |
67 }; | 70 }; |
68 | 71 |
69 // Window property key, that binds instance of DesktopBackgroundWidgetController | 72 // Window property key, that binds instance of DesktopBackgroundWidgetController |
70 // to root windows. | 73 // to root windows. |
71 extern const aura::WindowProperty<DesktopBackgroundWidgetController*>* const | 74 extern const aura::WindowProperty<DesktopBackgroundWidgetController*>* const |
72 kWindowDesktopComponent; | 75 kWindowDesktopComponent; |
73 | 76 |
74 extern const aura::WindowProperty<ComponentWrapper*>* const kComponentWrapper; | 77 extern const aura::WindowProperty<ComponentWrapper*>* const kComponentWrapper; |
75 | 78 |
76 } // namespace internal | 79 } // namespace internal |
77 } // namespace ash | 80 } // namespace ash |
78 | 81 |
79 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_WIDGET_CONTROLLER_H_ | 82 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_WIDGET_CONTROLLER_H_ |
OLD | NEW |