| 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 #include "services/ui/demo/mus_demo.h" | 5 #include "services/ui/demo/mus_demo.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "services/service_manager/public/cpp/connector.h" | 8 #include "services/service_manager/public/cpp/connector.h" |
| 9 #include "services/ui/demo/window_tree_data.h" | 9 #include "services/ui/demo/window_tree_data.h" |
| 10 #include "services/ui/public/cpp/gpu/gpu.h" | 10 #include "services/ui/public/cpp/gpu/gpu.h" |
| 11 #include "ui/aura/client/default_capture_client.h" | 11 #include "ui/aura/client/default_capture_client.h" |
| 12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
| 13 #include "ui/aura/mus/property_converter.h" | 13 #include "ui/aura/mus/property_converter.h" |
| 14 #include "ui/aura/mus/window_tree_client.h" | 14 #include "ui/aura/mus/window_tree_client.h" |
| 15 #include "ui/aura/mus/window_tree_host_mus.h" | 15 #include "ui/aura/mus/window_tree_host_mus.h" |
| 16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 17 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
| 18 #include "ui/wm/core/wm_state.h" | 18 #include "ui/wm/core/wm_state.h" |
| 19 | 19 |
| 20 namespace ui { | 20 namespace ui { |
| 21 namespace demo { | 21 namespace demo { |
| 22 | 22 |
| 23 MusDemo::MusDemo() {} | 23 MusDemo::MusDemo() {} |
| 24 | 24 |
| 25 MusDemo::~MusDemo() { | 25 MusDemo::~MusDemo() { |
| 26 display::Screen::SetScreenInstance(nullptr); | 26 display::Screen::SetScreenInstance(nullptr); |
| 27 // Destruction order is important here: |
| 28 // 1) Windows must be destroyed before WindowTreeClient's destructor is |
| 29 // called. |
| 30 // 2) WindowTreeClient must be destroyed before Env and WMState. |
| 31 window_tree_data_list_.clear(); |
| 32 window_tree_client_.reset(); |
| 33 env_.reset(); |
| 34 wm_state_.reset(); |
| 27 } | 35 } |
| 28 | 36 |
| 29 void MusDemo::AddPrimaryDisplay(const display::Display& display) { | 37 void MusDemo::AddPrimaryDisplay(const display::Display& display) { |
| 30 screen_->display_list().AddDisplay(display, | 38 screen_->display_list().AddDisplay(display, |
| 31 display::DisplayList::Type::PRIMARY); | 39 display::DisplayList::Type::PRIMARY); |
| 32 } | 40 } |
| 33 | 41 |
| 34 bool MusDemo::HasPendingWindowTreeData() const { | 42 bool MusDemo::HasPendingWindowTreeData() const { |
| 35 return !window_tree_data_list_.empty() && | 43 return !window_tree_data_list_.empty() && |
| 36 !window_tree_data_list_.back()->IsInitialized(); | 44 !window_tree_data_list_.back()->IsInitialized(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 107 |
| 100 void MusDemo::OnPointerEventObserved(const PointerEvent& event, | 108 void MusDemo::OnPointerEventObserved(const PointerEvent& event, |
| 101 aura::Window* target) {} | 109 aura::Window* target) {} |
| 102 | 110 |
| 103 aura::PropertyConverter* MusDemo::GetPropertyConverter() { | 111 aura::PropertyConverter* MusDemo::GetPropertyConverter() { |
| 104 return property_converter_.get(); | 112 return property_converter_.get(); |
| 105 } | 113 } |
| 106 | 114 |
| 107 } // namespace demo | 115 } // namespace demo |
| 108 } // namespace ui | 116 } // namespace ui |
| OLD | NEW |