OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/host/ash_window_tree_host_x11.h" | 5 #include "ash/host/ash_window_tree_host_x11.h" |
6 | 6 |
7 #include <X11/extensions/Xfixes.h> | 7 #include <X11/extensions/Xfixes.h> |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "ash/host/ash_window_tree_host_init_params.h" | 15 #include "ash/host/ash_window_tree_host_init_params.h" |
16 #include "ash/host/root_window_transformer.h" | 16 #include "ash/host/root_window_transformer.h" |
17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
18 #include "base/sys_info.h" | 18 #include "base/sys_info.h" |
19 #include "ui/aura/client/screen_position_client.h" | 19 #include "ui/aura/client/screen_position_client.h" |
20 #include "ui/aura/env.h" | 20 #include "ui/aura/env.h" |
21 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 22 #include "ui/aura/window_event_dispatcher.h" |
22 #include "ui/base/x/x11_util.h" | 23 #include "ui/base/x/x11_util.h" |
23 #include "ui/events/event.h" | 24 #include "ui/events/event.h" |
24 #include "ui/events/event_utils.h" | 25 #include "ui/events/event_utils.h" |
| 26 #include "ui/events/platform/platform_event_source.h" |
25 #include "ui/events/x/device_data_manager.h" | 27 #include "ui/events/x/device_data_manager.h" |
26 #include "ui/events/x/device_list_cache_x.h" | 28 #include "ui/events/x/device_list_cache_x.h" |
27 #include "ui/events/x/touch_factory_x11.h" | 29 #include "ui/events/x/touch_factory_x11.h" |
28 #include "ui/gfx/rect.h" | 30 #include "ui/gfx/rect.h" |
29 #include "ui/gfx/screen.h" | 31 #include "ui/gfx/screen.h" |
30 | 32 |
31 namespace ash { | 33 namespace ash { |
32 | 34 |
33 AshWindowTreeHostX11::AshWindowTreeHostX11(const gfx::Rect& initial_bounds) | 35 AshWindowTreeHostX11::AshWindowTreeHostX11(const gfx::Rect& initial_bounds) |
34 : WindowTreeHostX11(initial_bounds), | 36 : WindowTreeHostX11(initial_bounds), |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return transformer_helper_.GetHostInsets(); | 124 return transformer_helper_.GetHostInsets(); |
123 } | 125 } |
124 | 126 |
125 aura::WindowTreeHost* AshWindowTreeHostX11::AsWindowTreeHost() { return this; } | 127 aura::WindowTreeHost* AshWindowTreeHostX11::AsWindowTreeHost() { return this; } |
126 | 128 |
127 void AshWindowTreeHostX11::UpdateDisplayID(int64 id1, int64 id2) { | 129 void AshWindowTreeHostX11::UpdateDisplayID(int64 id1, int64 id2) { |
128 display_ids_.first = id1; | 130 display_ids_.first = id1; |
129 display_ids_.second = id2; | 131 display_ids_.second = id2; |
130 } | 132 } |
131 | 133 |
| 134 void AshWindowTreeHostX11::PrepareForShutdown() { |
| 135 if (ui::PlatformEventSource::GetInstance()) |
| 136 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); |
| 137 } |
| 138 |
132 void AshWindowTreeHostX11::SetBounds(const gfx::Rect& bounds) { | 139 void AshWindowTreeHostX11::SetBounds(const gfx::Rect& bounds) { |
133 WindowTreeHostX11::SetBounds(bounds); | 140 WindowTreeHostX11::SetBounds(bounds); |
134 if (pointer_barriers_) { | 141 if (pointer_barriers_) { |
135 UnConfineCursor(); | 142 UnConfineCursor(); |
136 ConfineCursorToRootWindow(); | 143 ConfineCursorToRootWindow(); |
137 } | 144 } |
138 } | 145 } |
139 | 146 |
140 gfx::Transform AshWindowTreeHostX11::GetRootTransform() const { | 147 gfx::Transform AshWindowTreeHostX11::GetRootTransform() const { |
141 return transformer_helper_.GetTransform(); | 148 return transformer_helper_.GetTransform(); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 } | 288 } |
282 } | 289 } |
283 } | 290 } |
284 | 291 |
285 AshWindowTreeHost* AshWindowTreeHost::Create( | 292 AshWindowTreeHost* AshWindowTreeHost::Create( |
286 const AshWindowTreeHostInitParams& init_params) { | 293 const AshWindowTreeHostInitParams& init_params) { |
287 return new AshWindowTreeHostX11(init_params.initial_bounds); | 294 return new AshWindowTreeHostX11(init_params.initial_bounds); |
288 } | 295 } |
289 | 296 |
290 } // namespace ash | 297 } // namespace ash |
OLD | NEW |