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 window_tree_data_list_.clear(); | |
| 28 window_tree_client_.reset(); | |
|
fwang
2017/03/20 11:45:39
Maybe add a comment that the destruction order is
kylechar
2017/03/20 13:27:42
Yes, please add a comment explaining the order.
msisov
2017/03/20 14:04:01
Done.
| |
| 27 } | 29 } |
| 28 | 30 |
| 29 void MusDemo::AddPrimaryDisplay(const display::Display& display) { | 31 void MusDemo::AddPrimaryDisplay(const display::Display& display) { |
| 30 screen_->display_list().AddDisplay(display, | 32 screen_->display_list().AddDisplay(display, |
| 31 display::DisplayList::Type::PRIMARY); | 33 display::DisplayList::Type::PRIMARY); |
| 32 } | 34 } |
| 33 | 35 |
| 34 bool MusDemo::HasPendingWindowTreeData() const { | 36 bool MusDemo::HasPendingWindowTreeData() const { |
| 35 return !window_tree_data_list_.empty() && | 37 return !window_tree_data_list_.empty() && |
| 36 !window_tree_data_list_.back()->IsInitialized(); | 38 !window_tree_data_list_.back()->IsInitialized(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 101 |
| 100 void MusDemo::OnPointerEventObserved(const PointerEvent& event, | 102 void MusDemo::OnPointerEventObserved(const PointerEvent& event, |
| 101 aura::Window* target) {} | 103 aura::Window* target) {} |
| 102 | 104 |
| 103 aura::PropertyConverter* MusDemo::GetPropertyConverter() { | 105 aura::PropertyConverter* MusDemo::GetPropertyConverter() { |
| 104 return property_converter_.get(); | 106 return property_converter_.get(); |
| 105 } | 107 } |
| 106 | 108 |
| 107 } // namespace demo | 109 } // namespace demo |
| 108 } // namespace ui | 110 } // namespace ui |
| OLD | NEW |