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