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

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

Issue 10821060: Use correct coordinates for last moust location in SynthesizeMouseMoveEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 base::Bind(&RootWindow::SynthesizeMouseMoveEvent, 981 base::Bind(&RootWindow::SynthesizeMouseMoveEvent,
982 event_factory_.GetWeakPtr())); 982 event_factory_.GetWeakPtr()));
983 } 983 }
984 984
985 void RootWindow::SynthesizeMouseMoveEvent() { 985 void RootWindow::SynthesizeMouseMoveEvent() {
986 if (!synthesize_mouse_move_) 986 if (!synthesize_mouse_move_)
987 return; 987 return;
988 synthesize_mouse_move_ = false; 988 synthesize_mouse_move_ = false;
989 #if !defined(OS_WIN) 989 #if !defined(OS_WIN)
990 // Temporarily disabled for windows. See crbug.com/112222. 990 // Temporarily disabled for windows. See crbug.com/112222.
991 gfx::Point3f point(Env::GetInstance()->last_mouse_location()); 991 gfx::Point3f point(GetLastMouseLocationInRoot());
992 ui::Transform transform = layer()->transform(); 992 ui::Transform transform = layer()->transform();
993 float scale = ui::GetDeviceScaleFactor(layer()); 993 float scale = ui::GetDeviceScaleFactor(layer());
994 transform.ConcatScale(scale, scale); 994 transform.ConcatScale(scale, scale);
995 transform.TransformPoint(point); 995 transform.TransformPoint(point);
996 gfx::Point orig_mouse_location = point.AsPoint(); 996 gfx::Point orig_mouse_location = point.AsPoint();
997 997
998 // TODO(derat|oshima): Don't use mouse_button_flags_ as it's 998 // TODO(derat|oshima): Don't use mouse_button_flags_ as it's
999 // currently broken. See/ crbug.com/107931. 999 // currently broken. See/ crbug.com/107931.
1000 MouseEvent event(ui::ET_MOUSE_MOVED, 1000 MouseEvent event(ui::ET_MOUSE_MOVED,
1001 orig_mouse_location, 1001 orig_mouse_location,
1002 orig_mouse_location, 1002 orig_mouse_location,
1003 ui::EF_IS_SYNTHESIZED); 1003 ui::EF_IS_SYNTHESIZED);
1004 DispatchMouseEvent(&event); 1004 DispatchMouseEvent(&event);
1005 #endif 1005 #endif
1006 } 1006 }
1007 1007
1008 void RootWindow::UnlockCompositor() { 1008 void RootWindow::UnlockCompositor() {
1009 DCHECK(compositor_lock_); 1009 DCHECK(compositor_lock_);
1010 compositor_lock_ = NULL; 1010 compositor_lock_ = NULL;
1011 if (draw_on_compositor_unlock_) { 1011 if (draw_on_compositor_unlock_) {
1012 draw_on_compositor_unlock_ = false; 1012 draw_on_compositor_unlock_ = false;
1013 ScheduleDraw(); 1013 ScheduleDraw();
1014 } 1014 }
1015 } 1015 }
1016 1016
1017 } // namespace aura 1017 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698