Chromium Code Reviews| Index: services/ui/demo/mus_demo.h |
| diff --git a/services/ui/demo/mus_demo.h b/services/ui/demo/mus_demo.h |
| index 941b2387be42874fd4287f2006f32215ba625cf4..fd04bdec01a6286d337083db66ffdccf2c4f0fb8 100644 |
| --- a/services/ui/demo/mus_demo.h |
| +++ b/services/ui/demo/mus_demo.h |
| @@ -17,6 +17,7 @@ |
| #include "services/service_manager/public/cpp/service.h" |
| #include "services/ui/public/cpp/window_manager_delegate.h" |
| #include "services/ui/public/cpp/window_tree_client_delegate.h" |
| +#include "services/ui/public/interfaces/window_tree_host.mojom.h" |
| #include "third_party/skia/include/core/SkBitmap.h" |
| #include "ui/display/screen_base.h" |
| @@ -30,13 +31,14 @@ namespace demo { |
| // new window and draws a spinning square in the center of the window. Provides |
| // a simple way to demonstrate that the graphic stack works as intended. |
| class MusDemo : public service_manager::Service, |
| - public WindowTreeClientDelegate, |
| - public WindowManagerDelegate { |
|
rjkroege
2016/11/18 22:47:14
I think this is going to break the CrOS world.
I
|
| + public WindowTreeClientDelegate { |
| public: |
| MusDemo(); |
| ~MusDemo() override; |
| private: |
| + struct WindowTreeData; |
| + |
| // service_manager::Service: |
| void OnStart() override; |
| bool OnConnect(const service_manager::ServiceInfo& remote_info, |
| @@ -49,53 +51,18 @@ class MusDemo : public service_manager::Service, |
| void OnPointerEventObserved(const PointerEvent& event, |
| Window* target) override; |
| - // WindowManagerDelegate: |
| - void SetWindowManagerClient(WindowManagerClient* client) override; |
| - bool OnWmSetBounds(Window* window, gfx::Rect* bounds) override; |
| - bool OnWmSetProperty( |
| - Window* window, |
| - const std::string& name, |
| - std::unique_ptr<std::vector<uint8_t>>* new_data) override; |
| - Window* OnWmCreateTopLevelWindow( |
| - std::map<std::string, std::vector<uint8_t>>* properties) override; |
| - void OnWmClientJankinessChanged(const std::set<Window*>& client_windows, |
| - bool janky) override; |
| - void OnWmNewDisplay(Window* window, const display::Display& display) override; |
| - void OnWmDisplayRemoved(ui::Window* window) override; |
| - void OnWmDisplayModified(const display::Display& display) override; |
| - void OnWmPerformMoveLoop(Window* window, |
| - mojom::MoveLoopSource source, |
| - const gfx::Point& cursor_location, |
| - const base::Callback<void(bool)>& on_done) override; |
| - void OnWmCancelMoveLoop(Window* window) override; |
| - |
| - // Allocate a bitmap the same size as the window to draw into. |
| - void AllocBitmap(); |
| + // Creates a new WindowTreeHost and adds its context to |window_tree_datas_|. |
| + void AddWindowTree(); |
| // Draws one frame, incrementing the rotation angle. |
| - void DrawFrame(); |
| + void DrawFrame(WindowTreeData* data); |
| - Window* window_ = nullptr; |
| - std::unique_ptr<WindowTreeClient> window_tree_client_; |
| std::unique_ptr<GpuService> gpu_service_; |
| // Dummy screen required to be the screen instance. |
| std::unique_ptr<display::ScreenBase> screen_; |
| - // Used to send frames to mus. |
| - std::unique_ptr<BitmapUploader> uploader_; |
| - |
| - // Bitmap that is the same size as our client window area. |
| - SkBitmap bitmap_; |
| - |
| - // Timer for calling DrawFrame(). |
| - base::RepeatingTimer timer_; |
| - |
| - // Current rotation angle for drawing. |
| - double angle_ = 0.0; |
| - |
| - // Last time a frame was drawn. |
| - base::TimeTicks last_draw_frame_time_; |
| + std::vector<std::unique_ptr<WindowTreeData>> window_tree_datas_; |
| DISALLOW_COPY_AND_ASSIGN(MusDemo); |
| }; |