Index: services/ui/demo/mus_demo.h |
diff --git a/services/ui/demo/mus_demo.h b/services/ui/demo/mus_demo.h |
index 55112dadbc22d512d8e755a09b804ba9e90ddb24..a881deccbaa504239f285b0b7989d7ed459ef263 100644 |
--- a/services/ui/demo/mus_demo.h |
+++ b/services/ui/demo/mus_demo.h |
@@ -28,6 +28,10 @@ class DefaultCaptureClient; |
} |
} // namespace aura |
+namespace aura_extra { |
+class ImageWindowDelegate; |
+} // namespace aura_extra |
+ |
namespace wm { |
class WMState; |
} |
@@ -46,6 +50,43 @@ class MusDemo : public service_manager::Service, |
MusDemo(); |
~MusDemo() override; |
+ protected: |
+ class WindowTreeData { |
kylechar
2017/02/14 16:58:10
This is a pretty big class. Is there any reason it
fwang
2017/02/14 17:20:26
I guess so. I was not sure either :-)
fwang
2017/02/15 13:45:06
Done.
|
+ public: |
+ explicit WindowTreeData( |
+ std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, |
+ int square_size); |
+ ~WindowTreeData(); |
+ |
+ private: |
+ // Initializes the window tree host and start drawing frames. |
+ void Init(std::unique_ptr<aura::WindowTreeHostMus> window_tree_host); |
+ |
+ // Draws one frame, incrementing the rotation angle. |
+ void DrawFrame(); |
+ |
+ // Helper function to retrieve the window to which we draw the bitmap. |
+ aura::Window* bitmap_window(); |
+ |
+ // The Window tree host corresponding to this data. |
+ std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_; |
+ |
+ // Destroys itself when the window gets destroyed. |
+ aura_extra::ImageWindowDelegate* window_delegate_ = nullptr; |
+ |
+ // Timer for calling DrawFrame(). |
+ base::RepeatingTimer timer_; |
+ |
+ // Current rotation angle for drawing. |
+ double angle_ = 0.0; |
+ |
+ // Size in pixels of the square to draw. |
+ const int square_size_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WindowTreeData); |
+ }; |
+ std::unique_ptr<WindowTreeData> window_tree_data_; |
kylechar
2017/02/14 16:58:10
Move to private section.
fwang
2017/02/14 17:20:26
Yes, this will be needed later (see https://codere
kylechar
2017/02/14 18:27:00
It should be in the private section regardless. If
fwang
2017/02/15 13:45:06
Done.
|
+ |
private: |
// service_manager::Service: |
void OnStart() override; |
@@ -102,9 +143,6 @@ class MusDemo : public service_manager::Service, |
std::unique_ptr<::wm::WMState> wm_state_; |
std::unique_ptr<aura::PropertyConverter> property_converter_; |
- class WindowTreeData; |
- std::unique_ptr<WindowTreeData> window_tree_data_; |
- |
DISALLOW_COPY_AND_ASSIGN(MusDemo); |
}; |