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

Side by Side Diff: components/mus/public/cpp/tests/window_tree_client_impl_private.cc

Issue 2008193002: Change mojo geometry structs from using type converters to StructTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
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 "components/mus/public/cpp/tests/window_tree_client_impl_private.h" 5 #include "components/mus/public/cpp/tests/window_tree_client_impl_private.h"
6 6
7 #include "components/mus/public/cpp/lib/window_tree_client_impl.h" 7 #include "components/mus/public/cpp/lib/window_tree_client_impl.h"
8 #include "components/mus/public/cpp/window.h" 8 #include "components/mus/public/cpp/window.h"
9 #include "ui/events/mojo/input_events_type_converters.h" 9 #include "ui/events/mojo/input_events_type_converters.h"
10 #include "ui/gfx/geometry/mojo/geometry_type_converters.h"
11 10
12 namespace mus { 11 namespace mus {
13 12
14 WindowTreeClientImplPrivate::WindowTreeClientImplPrivate( 13 WindowTreeClientImplPrivate::WindowTreeClientImplPrivate(
15 WindowTreeClientImpl* tree_client_impl) 14 WindowTreeClientImpl* tree_client_impl)
16 : tree_client_impl_(tree_client_impl) {} 15 : tree_client_impl_(tree_client_impl) {}
17 16
18 WindowTreeClientImplPrivate::WindowTreeClientImplPrivate(Window* window) 17 WindowTreeClientImplPrivate::WindowTreeClientImplPrivate(Window* window)
19 : WindowTreeClientImplPrivate(window->tree_client()) {} 18 : WindowTreeClientImplPrivate(window->tree_client()) {}
20 19
21 WindowTreeClientImplPrivate::~WindowTreeClientImplPrivate() {} 20 WindowTreeClientImplPrivate::~WindowTreeClientImplPrivate() {}
22 21
23 uint32_t WindowTreeClientImplPrivate::event_observer_id() { 22 uint32_t WindowTreeClientImplPrivate::event_observer_id() {
24 return tree_client_impl_->event_observer_id_; 23 return tree_client_impl_->event_observer_id_;
25 } 24 }
26 25
27 void WindowTreeClientImplPrivate::OnEmbed(mojom::WindowTree* window_tree) { 26 void WindowTreeClientImplPrivate::OnEmbed(mojom::WindowTree* window_tree) {
28 mojom::WindowDataPtr root_data(mojom::WindowData::New()); 27 mojom::WindowDataPtr root_data(mojom::WindowData::New());
29 root_data->parent_id = 0; 28 root_data->parent_id = 0;
30 root_data->window_id = 1; 29 root_data->window_id = 1;
31 root_data->bounds = mojo::Rect::From(gfx::Rect());
32 root_data->properties.SetToEmpty(); 30 root_data->properties.SetToEmpty();
33 root_data->visible = true; 31 root_data->visible = true;
34 const int64_t display_id = 1; 32 const int64_t display_id = 1;
35 const Id focused_window_id = 0; 33 const Id focused_window_id = 0;
36 tree_client_impl_->OnEmbedImpl(window_tree, 1, std::move(root_data), 34 tree_client_impl_->OnEmbedImpl(window_tree, 1, std::move(root_data),
37 display_id, focused_window_id, true); 35 display_id, focused_window_id, true);
38 } 36 }
39 37
40 void WindowTreeClientImplPrivate::CallOnWindowInputEvent( 38 void WindowTreeClientImplPrivate::CallOnWindowInputEvent(
41 Window* window, 39 Window* window,
42 const ui::Event& event) { 40 const ui::Event& event) {
43 const uint32_t event_id = 0u; 41 const uint32_t event_id = 0u;
44 const uint32_t observer_id = 0u; 42 const uint32_t observer_id = 0u;
45 tree_client_impl_->OnWindowInputEvent(event_id, window->server_id(), 43 tree_client_impl_->OnWindowInputEvent(event_id, window->server_id(),
46 mojom::Event::From(event), observer_id); 44 mojom::Event::From(event), observer_id);
47 } 45 }
48 46
49 } // namespace mus 47 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698