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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |