| 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/mus/window_tree_host_mus_init_params.h" | 9 #include "ui/aura/mus/window_tree_host_mus_init_params.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 void WindowTreeClientPrivate::OnEmbed(ui::mojom::WindowTree* window_tree) { | 25 void WindowTreeClientPrivate::OnEmbed(ui::mojom::WindowTree* window_tree) { |
| 26 ui::mojom::WindowDataPtr root_data(ui::mojom::WindowData::New()); | 26 ui::mojom::WindowDataPtr root_data(ui::mojom::WindowData::New()); |
| 27 root_data->parent_id = 0; | 27 root_data->parent_id = 0; |
| 28 root_data->window_id = next_window_id_++; | 28 root_data->window_id = next_window_id_++; |
| 29 root_data->visible = true; | 29 root_data->visible = true; |
| 30 const int64_t display_id = 1; | 30 const int64_t display_id = 1; |
| 31 const Id focused_window_id = 0; | 31 const Id focused_window_id = 0; |
| 32 tree_client_impl_->OnEmbedImpl(window_tree, 1, std::move(root_data), | 32 tree_client_impl_->OnEmbedImpl(window_tree, 1, std::move(root_data), |
| 33 display_id, focused_window_id, true, | 33 display_id, focused_window_id, true, |
| 34 cc::FrameSinkId(1, 1), base::nullopt); | 34 base::nullopt); |
| 35 } | 35 } |
| 36 | 36 |
| 37 WindowTreeHostMus* WindowTreeClientPrivate::CallWmNewDisplayAdded( | 37 WindowTreeHostMus* WindowTreeClientPrivate::CallWmNewDisplayAdded( |
| 38 const display::Display& display) { | 38 const display::Display& display) { |
| 39 ui::mojom::WindowDataPtr root_data(ui::mojom::WindowData::New()); | 39 ui::mojom::WindowDataPtr root_data(ui::mojom::WindowData::New()); |
| 40 root_data->parent_id = 0; | 40 root_data->parent_id = 0; |
| 41 root_data->window_id = next_window_id_++; | 41 root_data->window_id = next_window_id_++; |
| 42 root_data->visible = true; | 42 root_data->visible = true; |
| 43 root_data->bounds = gfx::Rect(display.bounds().size()); | 43 root_data->bounds = gfx::Rect(display.bounds().size()); |
| 44 const bool parent_drawn = true; | 44 const bool parent_drawn = true; |
| 45 return CallWmNewDisplayAdded(display, std::move(root_data), parent_drawn); | 45 return CallWmNewDisplayAdded(display, std::move(root_data), parent_drawn); |
| 46 } | 46 } |
| 47 | 47 |
| 48 WindowTreeHostMus* WindowTreeClientPrivate::CallWmNewDisplayAdded( | 48 WindowTreeHostMus* WindowTreeClientPrivate::CallWmNewDisplayAdded( |
| 49 const display::Display& display, | 49 const display::Display& display, |
| 50 ui::mojom::WindowDataPtr root_data, | 50 ui::mojom::WindowDataPtr root_data, |
| 51 bool parent_drawn) { | 51 bool parent_drawn) { |
| 52 return tree_client_impl_->WmNewDisplayAddedImpl( | 52 return tree_client_impl_->WmNewDisplayAddedImpl(display, std::move(root_data), |
| 53 display, std::move(root_data), parent_drawn, cc::FrameSinkId(1, 1), | 53 parent_drawn, base::nullopt); |
| 54 base::nullopt); | |
| 55 } | 54 } |
| 56 | 55 |
| 57 void WindowTreeClientPrivate::CallOnWindowInputEvent( | 56 void WindowTreeClientPrivate::CallOnWindowInputEvent( |
| 58 Window* window, | 57 Window* window, |
| 59 std::unique_ptr<ui::Event> event) { | 58 std::unique_ptr<ui::Event> event) { |
| 60 const uint32_t event_id = 0u; | 59 const uint32_t event_id = 0u; |
| 61 const uint32_t observer_id = 0u; | 60 const uint32_t observer_id = 0u; |
| 62 const int64_t display_id = 0; | 61 const int64_t display_id = 0; |
| 63 tree_client_impl_->OnWindowInputEvent( | 62 tree_client_impl_->OnWindowInputEvent( |
| 64 event_id, WindowPortMus::Get(window)->server_id(), display_id, | 63 event_id, WindowPortMus::Get(window)->server_id(), display_id, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 bool WindowTreeClientPrivate::HasPointerWatcher() { | 106 bool WindowTreeClientPrivate::HasPointerWatcher() { |
| 108 return tree_client_impl_->has_pointer_watcher_; | 107 return tree_client_impl_->has_pointer_watcher_; |
| 109 } | 108 } |
| 110 | 109 |
| 111 Window* WindowTreeClientPrivate::GetWindowByServerId(Id id) { | 110 Window* WindowTreeClientPrivate::GetWindowByServerId(Id id) { |
| 112 WindowMus* window = tree_client_impl_->GetWindowByServerId(id); | 111 WindowMus* window = tree_client_impl_->GetWindowByServerId(id); |
| 113 return window ? window->GetWindow() : nullptr; | 112 return window ? window->GetWindow() : nullptr; |
| 114 } | 113 } |
| 115 | 114 |
| 116 } // namespace aura | 115 } // namespace aura |
| OLD | NEW |