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 #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 // WindowTreeClient must be destroyed before Env and WMState, otherwise | |
| 29 // segfault occurs as long as WindowTreeClient uses these singletons in it's | |
| 30 // dtor. | |
|
kylechar
2017/03/21 12:44:45
s/dtor/destructor
| |
| 31 window_tree_data_list_.clear(); | |
| 32 window_tree_client_.reset(); | |
|
fwang
2017/03/21 07:12:02
Two points:
1) I think you should explain that win
msisov
2017/03/21 07:16:55
Done.
| |
| 27 } | 33 } |
| 28 | 34 |
| 29 void MusDemo::AddPrimaryDisplay(const display::Display& display) { | 35 void MusDemo::AddPrimaryDisplay(const display::Display& display) { |
| 30 screen_->display_list().AddDisplay(display, | 36 screen_->display_list().AddDisplay(display, |
| 31 display::DisplayList::Type::PRIMARY); | 37 display::DisplayList::Type::PRIMARY); |
| 32 } | 38 } |
| 33 | 39 |
| 34 bool MusDemo::HasPendingWindowTreeData() const { | 40 bool MusDemo::HasPendingWindowTreeData() const { |
| 35 return !window_tree_data_list_.empty() && | 41 return !window_tree_data_list_.empty() && |
| 36 !window_tree_data_list_.back()->IsInitialized(); | 42 !window_tree_data_list_.back()->IsInitialized(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 105 |
| 100 void MusDemo::OnPointerEventObserved(const PointerEvent& event, | 106 void MusDemo::OnPointerEventObserved(const PointerEvent& event, |
| 101 aura::Window* target) {} | 107 aura::Window* target) {} |
| 102 | 108 |
| 103 aura::PropertyConverter* MusDemo::GetPropertyConverter() { | 109 aura::PropertyConverter* MusDemo::GetPropertyConverter() { |
| 104 return property_converter_.get(); | 110 return property_converter_.get(); |
| 105 } | 111 } |
| 106 | 112 |
| 107 } // namespace demo | 113 } // namespace demo |
| 108 } // namespace ui | 114 } // namespace ui |
| OLD | NEW |