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

Side by Side Diff: ui/aura/root_window.cc

Issue 10388141: Full-screen Magnifier: Support warping the cursor on the edge (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Review fix Created 8 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
« ash/magnifier/magnification_controller.cc ('K') | « ash/shell.cc ('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 (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
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
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
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
OLDNEW
« ash/magnifier/magnification_controller.cc ('K') | « ash/shell.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698