OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
25 #include "ui/aura/window_delegate.h" | 25 #include "ui/aura/window_delegate.h" |
26 #include "ui/base/gestures/gesture_recognizer.h" | 26 #include "ui/base/gestures/gesture_recognizer.h" |
27 #include "ui/base/gestures/gesture_types.h" | 27 #include "ui/base/gestures/gesture_types.h" |
28 #include "ui/base/hit_test.h" | 28 #include "ui/base/hit_test.h" |
29 #include "ui/compositor/compositor.h" | 29 #include "ui/compositor/compositor.h" |
30 #include "ui/compositor/dip_util.h" | 30 #include "ui/compositor/dip_util.h" |
31 #include "ui/compositor/layer.h" | 31 #include "ui/compositor/layer.h" |
32 #include "ui/compositor/layer_animator.h" | 32 #include "ui/compositor/layer_animator.h" |
33 #include "ui/gfx/monitor.h" | 33 #include "ui/gfx/monitor.h" |
34 #include "ui/gfx/point3.h" | |
sky
2012/06/11 16:19:14
remove include.
yoshiki
2012/06/19 17:56:16
Done.
| |
34 #include "ui/gfx/screen.h" | 35 #include "ui/gfx/screen.h" |
35 | 36 |
36 using std::vector; | 37 using std::vector; |
37 | 38 |
38 namespace aura { | 39 namespace aura { |
39 | 40 |
40 namespace { | 41 namespace { |
41 | 42 |
42 // These are the mouse events generated when a gesture goes unprocessed. | 43 // These are the mouse events generated when a gesture goes unprocessed. |
43 const ui::EventType kScrollBeginTypes[] = { | 44 const ui::EventType kScrollBeginTypes[] = { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 // so just pass everything along to the host. | 212 // so just pass everything along to the host. |
212 host_->SetCursor(cursor); | 213 host_->SetCursor(cursor); |
213 } | 214 } |
214 | 215 |
215 void RootWindow::ShowCursor(bool show) { | 216 void RootWindow::ShowCursor(bool show) { |
216 cursor_shown_ = show; | 217 cursor_shown_ = show; |
217 host_->ShowCursor(show); | 218 host_->ShowCursor(show); |
218 } | 219 } |
219 | 220 |
220 void RootWindow::MoveCursorTo(const gfx::Point& location_in_dip) { | 221 void RootWindow::MoveCursorTo(const gfx::Point& location_in_dip) { |
221 host_->MoveCursorTo(ui::ConvertPointToPixel(layer(), location_in_dip)); | 222 gfx::Point location = location_in_dip; |
223 layer()->transform().TransformPoint(location); | |
oshima
2012/06/11 21:48:30
I look at the code a bit closely and I think what
yoshiki
2012/06/19 17:56:16
Done.
| |
224 host_->MoveCursorTo(ui::ConvertPointToPixel(layer(), location)); | |
222 } | 225 } |
223 | 226 |
224 bool RootWindow::ConfineCursorToWindow() { | 227 bool RootWindow::ConfineCursorToWindow() { |
225 // We would like to be able to confine the cursor to that window. However, | 228 // We would like to be able to confine the cursor to that window. However, |
226 // currently, we do not have such functionality in X. So we just confine | 229 // currently, we do not have such functionality in X. So we just confine |
227 // to the root window. This is ok because this option is currently only | 230 // to the root window. This is ok because this option is currently only |
228 // being used in fullscreen mode, so root_window bounds = window bounds. | 231 // being used in fullscreen mode, so root_window bounds = window bounds. |
229 return host_->ConfineCursorToRootWindow(); | 232 return host_->ConfineCursorToRootWindow(); |
230 } | 233 } |
231 | 234 |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1019 void RootWindow::UnlockCompositor() { | 1022 void RootWindow::UnlockCompositor() { |
1020 DCHECK(compositor_lock_); | 1023 DCHECK(compositor_lock_); |
1021 compositor_lock_ = NULL; | 1024 compositor_lock_ = NULL; |
1022 if (draw_on_compositor_unlock_) { | 1025 if (draw_on_compositor_unlock_) { |
1023 draw_on_compositor_unlock_ = false; | 1026 draw_on_compositor_unlock_ = false; |
1024 ScheduleDraw(); | 1027 ScheduleDraw(); |
1025 } | 1028 } |
1026 } | 1029 } |
1027 | 1030 |
1028 } // namespace aura | 1031 } // namespace aura |
OLD | NEW |