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 14 matching lines...) Expand all Loading... | |
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/screen.h" | 34 #include "ui/gfx/screen.h" |
35 #include "ui/gfx/point3.h" | |
sky
2012/06/07 18:05:50
sort
yoshiki
2012/06/08 22:27:45
Done.
| |
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[] = { |
44 ui::ET_MOUSE_PRESSED, ui::ET_MOUSE_DRAGGED, ui::ET_UNKNOWN }; | 45 ui::ET_MOUSE_PRESSED, ui::ET_MOUSE_DRAGGED, ui::ET_UNKNOWN }; |
(...skipping 166 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::Point3f p3(location_in_dip); |
sky
2012/06/07 18:05:50
Why do we need point3 here?
oshima
2012/06/07 18:25:07
Transform convert gfx::point to point3 internally,
yoshiki
2012/06/08 22:27:45
Done.
| |
223 layer()->transform().TransformPoint(p3); | |
oshima
2012/06/07 18:25:07
I believe location_in_dip is in DIP coordinate sys
yoshiki
2012/06/08 22:27:45
oshima: Sorry, I can't find it in render_widget_ho
oshima
2012/06/11 16:51:18
no, what I meant is the all mouse events fed to au
| |
224 gfx::Point p(p3.AsPoint()); | |
225 | |
226 host_->MoveCursorTo(ui::ConvertPointToPixel(layer(), p)); | |
222 } | 227 } |
223 | 228 |
224 bool RootWindow::ConfineCursorToWindow() { | 229 bool RootWindow::ConfineCursorToWindow() { |
225 // We would like to be able to confine the cursor to that window. However, | 230 // 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 | 231 // 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 | 232 // 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. | 233 // being used in fullscreen mode, so root_window bounds = window bounds. |
229 return host_->ConfineCursorToRootWindow(); | 234 return host_->ConfineCursorToRootWindow(); |
230 } | 235 } |
231 | 236 |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1019 void RootWindow::UnlockCompositor() { | 1024 void RootWindow::UnlockCompositor() { |
1020 DCHECK(compositor_lock_); | 1025 DCHECK(compositor_lock_); |
1021 compositor_lock_ = NULL; | 1026 compositor_lock_ = NULL; |
1022 if (draw_on_compositor_unlock_) { | 1027 if (draw_on_compositor_unlock_) { |
1023 draw_on_compositor_unlock_ = false; | 1028 draw_on_compositor_unlock_ = false; |
1024 ScheduleDraw(); | 1029 ScheduleDraw(); |
1025 } | 1030 } |
1026 } | 1031 } |
1027 | 1032 |
1028 } // namespace aura | 1033 } // namespace aura |
OLD | NEW |