| 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 <memory> | 5 #include <memory> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 namespace ui { | 32 namespace ui { |
| 33 namespace test { | 33 namespace test { |
| 34 | 34 |
| 35 class TestWM : public service_manager::Service, | 35 class TestWM : public service_manager::Service, |
| 36 public aura::WindowTreeClientDelegate, | 36 public aura::WindowTreeClientDelegate, |
| 37 public aura::WindowManagerDelegate { | 37 public aura::WindowManagerDelegate { |
| 38 public: | 38 public: |
| 39 TestWM() {} | 39 TestWM() {} |
| 40 | 40 |
| 41 ~TestWM() override { | 41 ~TestWM() override { |
| 42 default_capture_client_.reset(); |
| 43 |
| 42 // WindowTreeHost uses state from WindowTreeClient, so destroy it first. | 44 // WindowTreeHost uses state from WindowTreeClient, so destroy it first. |
| 43 window_tree_host_.reset(); | 45 window_tree_host_.reset(); |
| 44 | 46 |
| 45 // WindowTreeClient destruction may callback to us. | 47 // WindowTreeClient destruction may callback to us. |
| 46 window_tree_client_.reset(); | 48 window_tree_client_.reset(); |
| 47 | 49 |
| 48 display::Screen::SetScreenInstance(nullptr); | 50 display::Screen::SetScreenInstance(nullptr); |
| 49 } | 51 } |
| 50 | 52 |
| 51 private: | 53 private: |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 ui::mojom::FrameDecorationValuesPtr frame_decoration_values = | 142 ui::mojom::FrameDecorationValuesPtr frame_decoration_values = |
| 141 ui::mojom::FrameDecorationValues::New(); | 143 ui::mojom::FrameDecorationValues::New(); |
| 142 frame_decoration_values->max_title_bar_button_width = 0; | 144 frame_decoration_values->max_title_bar_button_width = 0; |
| 143 window_manager_client_->SetFrameDecorationValues( | 145 window_manager_client_->SetFrameDecorationValues( |
| 144 std::move(frame_decoration_values)); | 146 std::move(frame_decoration_values)); |
| 145 aura::client::SetFocusClient(root_, &focus_client_); | 147 aura::client::SetFocusClient(root_, &focus_client_); |
| 146 } | 148 } |
| 147 void OnWmDisplayRemoved(aura::WindowTreeHostMus* window_tree_host) override { | 149 void OnWmDisplayRemoved(aura::WindowTreeHostMus* window_tree_host) override { |
| 148 DCHECK_EQ(window_tree_host, window_tree_host_.get()); | 150 DCHECK_EQ(window_tree_host, window_tree_host_.get()); |
| 149 root_ = nullptr; | 151 root_ = nullptr; |
| 152 default_capture_client_.reset(); |
| 150 window_tree_host_.reset(); | 153 window_tree_host_.reset(); |
| 151 } | 154 } |
| 152 void OnWmDisplayModified(const display::Display& display) override {} | 155 void OnWmDisplayModified(const display::Display& display) override {} |
| 153 void OnWmPerformMoveLoop(aura::Window* window, | 156 void OnWmPerformMoveLoop(aura::Window* window, |
| 154 mojom::MoveLoopSource source, | 157 mojom::MoveLoopSource source, |
| 155 const gfx::Point& cursor_location, | 158 const gfx::Point& cursor_location, |
| 156 const base::Callback<void(bool)>& on_done) override { | 159 const base::Callback<void(bool)>& on_done) override { |
| 157 // Don't care. | 160 // Don't care. |
| 158 } | 161 } |
| 159 void OnWmCancelMoveLoop(aura::Window* window) override {} | 162 void OnWmCancelMoveLoop(aura::Window* window) override {} |
| (...skipping 26 matching lines...) Expand all Loading... |
| 186 DISALLOW_COPY_AND_ASSIGN(TestWM); | 189 DISALLOW_COPY_AND_ASSIGN(TestWM); |
| 187 }; | 190 }; |
| 188 | 191 |
| 189 } // namespace test | 192 } // namespace test |
| 190 } // namespace ui | 193 } // namespace ui |
| 191 | 194 |
| 192 MojoResult ServiceMain(MojoHandle service_request_handle) { | 195 MojoResult ServiceMain(MojoHandle service_request_handle) { |
| 193 service_manager::ServiceRunner runner(new ui::test::TestWM); | 196 service_manager::ServiceRunner runner(new ui::test::TestWM); |
| 194 return runner.Run(service_request_handle); | 197 return runner.Run(service_request_handle); |
| 195 } | 198 } |
| OLD | NEW |