Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: services/ui/public/cpp/tests/window_tree_client_private.cc

Issue 2322613002: Adds support for multiple displays to WmTestBase (Closed)
Patch Set: feedback Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/public/cpp/tests/window_tree_client_private.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 = 1; 26 root_data->window_id = next_window_id_++;
27 root_data->properties.SetToEmpty(); 27 root_data->properties.SetToEmpty();
28 root_data->visible = true; 28 root_data->visible = true;
29 const int64_t display_id = 1; 29 const int64_t display_id = 1;
30 const Id focused_window_id = 0; 30 const Id focused_window_id = 0;
31 tree_client_impl_->OnEmbedImpl(window_tree, 1, std::move(root_data), 31 tree_client_impl_->OnEmbedImpl(window_tree, 1, std::move(root_data),
32 display_id, focused_window_id, true); 32 display_id, focused_window_id, true);
33 } 33 }
34 34
35 void WindowTreeClientPrivate::CallWmNewDisplayAdded( 35 void WindowTreeClientPrivate::CallWmNewDisplayAdded(
36 const display::Display& display) { 36 const display::Display& display) {
37 mojom::WindowDataPtr root_data(mojom::WindowData::New()); 37 mojom::WindowDataPtr root_data(mojom::WindowData::New());
38 root_data->parent_id = 0; 38 root_data->parent_id = 0;
39 root_data->window_id = 1; 39 root_data->window_id = next_window_id_++;
40 root_data->properties.SetToEmpty(); 40 root_data->properties.SetToEmpty();
41 root_data->visible = true; 41 root_data->visible = true;
42 root_data->bounds = gfx::Rect(display.bounds().size()); 42 root_data->bounds = gfx::Rect(display.bounds().size());
43 const bool parent_drawn = true; 43 const bool parent_drawn = true;
44 tree_client_impl_->WmNewDisplayAddedImpl(display, std::move(root_data), 44 tree_client_impl_->WmNewDisplayAddedImpl(display, std::move(root_data),
45 parent_drawn); 45 parent_drawn);
46 } 46 }
47 47
48 void WindowTreeClientPrivate::CallOnWindowInputEvent( 48 void WindowTreeClientPrivate::CallOnWindowInputEvent(
49 Window* window, 49 Window* window,
(...skipping 15 matching lines...) Expand all
65 ClientSpecificId client_id) { 65 ClientSpecificId client_id) {
66 tree_client_impl_->tree_ = window_tree; 66 tree_client_impl_->tree_ = window_tree;
67 tree_client_impl_->client_id_ = client_id; 67 tree_client_impl_->client_id_ = client_id;
68 } 68 }
69 69
70 bool WindowTreeClientPrivate::HasPointerWatcher() { 70 bool WindowTreeClientPrivate::HasPointerWatcher() {
71 return tree_client_impl_->has_pointer_watcher_; 71 return tree_client_impl_->has_pointer_watcher_;
72 } 72 }
73 73
74 } // namespace ui 74 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/tests/window_tree_client_private.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698