| 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 "ui/aura/test/mus/window_tree_client_private.h" | 5 #include "ui/aura/test/mus/window_tree_client_private.h" |
| 6 | 6 |
| 7 #include "ui/aura/mus/window_port_mus.h" | 7 #include "ui/aura/mus/window_port_mus.h" |
| 8 #include "ui/aura/mus/window_tree_client.h" | 8 #include "ui/aura/mus/window_tree_client.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/display/display.h" | 10 #include "ui/display/display.h" |
| 11 | 11 |
| 12 namespace aura { | 12 namespace aura { |
| 13 | 13 |
| 14 WindowTreeClientPrivate::WindowTreeClientPrivate( | 14 WindowTreeClientPrivate::WindowTreeClientPrivate( |
| 15 WindowTreeClient* tree_client_impl) | 15 WindowTreeClient* tree_client_impl) |
| 16 : tree_client_impl_(tree_client_impl) {} | 16 : tree_client_impl_(tree_client_impl) {} |
| 17 | 17 |
| 18 WindowTreeClientPrivate::WindowTreeClientPrivate(Window* window) | 18 WindowTreeClientPrivate::WindowTreeClientPrivate(Window* window) |
| 19 : WindowTreeClientPrivate(WindowPortMus::Get(window)->window_tree_client_) { | 19 : WindowTreeClientPrivate(WindowPortMus::Get(window)->window_tree_client_) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 WindowTreeClientPrivate::~WindowTreeClientPrivate() {} | 22 WindowTreeClientPrivate::~WindowTreeClientPrivate() {} |
| 23 | 23 |
| 24 void WindowTreeClientPrivate::OnEmbed(ui::mojom::WindowTree* window_tree) { | 24 void WindowTreeClientPrivate::OnEmbed(ui::mojom::WindowTree* window_tree) { |
| 25 ui::mojom::WindowDataPtr root_data(ui::mojom::WindowData::New()); | 25 ui::mojom::WindowDataPtr root_data(ui::mojom::WindowData::New()); |
| 26 root_data->parent_id = 0; | 26 root_data->parent_id = 0; |
| 27 root_data->window_id = next_window_id_++; | 27 root_data->window_id = next_window_id_++; |
| 28 root_data->properties.SetToEmpty(); | |
| 29 root_data->visible = true; | 28 root_data->visible = true; |
| 30 const int64_t display_id = 1; | 29 const int64_t display_id = 1; |
| 31 const Id focused_window_id = 0; | 30 const Id focused_window_id = 0; |
| 32 tree_client_impl_->OnEmbedImpl(window_tree, 1, std::move(root_data), | 31 tree_client_impl_->OnEmbedImpl(window_tree, 1, std::move(root_data), |
| 33 display_id, focused_window_id, true); | 32 display_id, focused_window_id, true); |
| 34 } | 33 } |
| 35 | 34 |
| 36 WindowTreeHost* WindowTreeClientPrivate::CallWmNewDisplayAdded( | 35 WindowTreeHost* WindowTreeClientPrivate::CallWmNewDisplayAdded( |
| 37 const display::Display& display) { | 36 const display::Display& display) { |
| 38 ui::mojom::WindowDataPtr root_data(ui::mojom::WindowData::New()); | 37 ui::mojom::WindowDataPtr root_data(ui::mojom::WindowData::New()); |
| 39 root_data->parent_id = 0; | 38 root_data->parent_id = 0; |
| 40 root_data->window_id = next_window_id_++; | 39 root_data->window_id = next_window_id_++; |
| 41 root_data->properties.SetToEmpty(); | |
| 42 root_data->visible = true; | 40 root_data->visible = true; |
| 43 root_data->bounds = gfx::Rect(display.bounds().size()); | 41 root_data->bounds = gfx::Rect(display.bounds().size()); |
| 44 const bool parent_drawn = true; | 42 const bool parent_drawn = true; |
| 45 return tree_client_impl_->WmNewDisplayAddedImpl(display, std::move(root_data), | 43 return tree_client_impl_->WmNewDisplayAddedImpl(display, std::move(root_data), |
| 46 parent_drawn); | 44 parent_drawn); |
| 47 } | 45 } |
| 48 | 46 |
| 49 void WindowTreeClientPrivate::CallOnWindowInputEvent( | 47 void WindowTreeClientPrivate::CallOnWindowInputEvent( |
| 50 Window* window, | 48 Window* window, |
| 51 std::unique_ptr<ui::Event> event) { | 49 std::unique_ptr<ui::Event> event) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 68 ClientSpecificId client_id) { | 66 ClientSpecificId client_id) { |
| 69 tree_client_impl_->WindowTreeConnectionEstablished(window_tree); | 67 tree_client_impl_->WindowTreeConnectionEstablished(window_tree); |
| 70 tree_client_impl_->client_id_ = client_id; | 68 tree_client_impl_->client_id_ = client_id; |
| 71 } | 69 } |
| 72 | 70 |
| 73 bool WindowTreeClientPrivate::HasPointerWatcher() { | 71 bool WindowTreeClientPrivate::HasPointerWatcher() { |
| 74 return tree_client_impl_->has_pointer_watcher_; | 72 return tree_client_impl_->has_pointer_watcher_; |
| 75 } | 73 } |
| 76 | 74 |
| 77 } // namespace aura | 75 } // namespace aura |
| OLD | NEW |