Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_UI_DEMO_MUS_DEMO_H_ | 5 #ifndef SERVICES_UI_DEMO_MUS_DEMO_H_ |
| 6 #define SERVICES_UI_DEMO_MUS_DEMO_H_ | 6 #define SERVICES_UI_DEMO_MUS_DEMO_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 // the window. Provides a simple way to demonstrate that the graphic stack works | 37 // the window. Provides a simple way to demonstrate that the graphic stack works |
| 38 // as intended. | 38 // as intended. |
| 39 class MusDemo : public service_manager::Service, | 39 class MusDemo : public service_manager::Service, |
| 40 public aura::WindowTreeClientDelegate { | 40 public aura::WindowTreeClientDelegate { |
| 41 public: | 41 public: |
| 42 MusDemo(); | 42 MusDemo(); |
| 43 ~MusDemo() override; | 43 ~MusDemo() override; |
| 44 | 44 |
| 45 protected: | 45 protected: |
| 46 void AddPrimaryDisplay(const display::Display& display); | 46 void AddPrimaryDisplay(const display::Display& display); |
| 47 void AppendWindowTreeData(std::unique_ptr<WindowTreeData> window_tree_data); | |
|
kylechar
2017/02/23 22:45:30
Can you walk me through the flow of how this is su
fwang
2017/02/24 10:08:50
Sure. This is explained in a comment above window_
| |
| 47 void InitWindowTreeData( | 48 void InitWindowTreeData( |
| 48 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host); | 49 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host); |
| 49 void CleanupWindowTreeData(); | 50 void RemoveWindowTreeDataFor(aura::WindowTreeHostMus* window_tree_host); |
|
kylechar
2017/02/23 22:45:30
nit: RemoveWindowTreeData maybe?
fwang
2017/02/24 10:08:50
Antonio suggested to change to RemoveWindowTreeDat
fwang
2017/02/24 10:40:10
Done.
| |
| 51 aura::WindowTreeClient* window_tree_client() { | |
| 52 return window_tree_client_.get(); | |
| 53 } | |
| 50 | 54 |
| 51 private: | 55 private: |
| 52 virtual void OnStartImpl( | 56 virtual void OnStartImpl() = 0; |
| 53 std::unique_ptr<aura::WindowTreeClient>* window_tree_client, | 57 virtual std::unique_ptr<aura::WindowTreeClient> CreateWindowTreeClient() = 0; |
| 54 std::unique_ptr<WindowTreeData>* window_tree_data) = 0; | 58 bool HasPendingWindowTreeData() const; |
| 55 | 59 |
| 56 // service_manager::Service: | 60 // service_manager::Service: |
| 57 void OnStart() override; | 61 void OnStart() override; |
| 58 bool OnConnect(const service_manager::ServiceInfo& remote_info, | 62 bool OnConnect(const service_manager::ServiceInfo& remote_info, |
| 59 service_manager::InterfaceRegistry* registry) override; | 63 service_manager::InterfaceRegistry* registry) override; |
| 60 | 64 |
| 61 // aura::WindowTreeClientDelegate: | 65 // aura::WindowTreeClientDelegate: |
| 62 void OnEmbed( | 66 void OnEmbed( |
| 63 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override; | 67 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override; |
| 64 void OnUnembed(aura::Window* root) override; | 68 void OnUnembed(aura::Window* root) override; |
| 65 void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override; | 69 void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override; |
| 66 void OnLostConnection(aura::WindowTreeClient* client) override; | 70 void OnLostConnection(aura::WindowTreeClient* client) override; |
| 67 void OnPointerEventObserved(const ui::PointerEvent& event, | 71 void OnPointerEventObserved(const ui::PointerEvent& event, |
| 68 aura::Window* target) override; | 72 aura::Window* target) override; |
| 69 aura::PropertyConverter* GetPropertyConverter() override; | 73 aura::PropertyConverter* GetPropertyConverter() override; |
| 70 | 74 |
| 71 std::unique_ptr<aura::WindowTreeClient> window_tree_client_; | 75 std::unique_ptr<aura::WindowTreeClient> window_tree_client_; |
| 72 std::unique_ptr<aura::Env> env_; | 76 std::unique_ptr<aura::Env> env_; |
| 73 std::unique_ptr<display::ScreenBase> screen_; | 77 std::unique_ptr<display::ScreenBase> screen_; |
| 74 | 78 |
| 75 std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_; | 79 std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_; |
| 76 std::unique_ptr<::wm::WMState> wm_state_; | 80 std::unique_ptr<::wm::WMState> wm_state_; |
| 77 std::unique_ptr<aura::PropertyConverter> property_converter_; | 81 std::unique_ptr<aura::PropertyConverter> property_converter_; |
| 78 | 82 |
| 79 std::unique_ptr<WindowTreeData> window_tree_data_; | 83 // List of WindowTreeData structures. When a new window is opened, its data |
| 84 // is appended at the end of that list and it remains uninitialized until the | |
| 85 // next call to InitWindowTreeData. | |
| 86 std::vector<std::unique_ptr<WindowTreeData>> window_tree_data_list_; | |
| 80 | 87 |
| 81 DISALLOW_COPY_AND_ASSIGN(MusDemo); | 88 DISALLOW_COPY_AND_ASSIGN(MusDemo); |
| 82 }; | 89 }; |
| 83 | 90 |
| 84 } // namespace demo | 91 } // namespace demo |
| 85 } // namespace ui | 92 } // namespace ui |
| 86 | 93 |
| 87 #endif // SERVICES_UI_DEMO_MUS_DEMO_H_ | 94 #endif // SERVICES_UI_DEMO_MUS_DEMO_H_ |
| OLD | NEW |