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

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

Issue 12092051: Reenable synthesized mouse event on win aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | ui/aura/window_unittest.cc » ('j') | 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/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 MessageLoop::current()->PostTask( 985 MessageLoop::current()->PostTask(
986 FROM_HERE, 986 FROM_HERE,
987 base::Bind(&RootWindow::SynthesizeMouseMoveEvent, 987 base::Bind(&RootWindow::SynthesizeMouseMoveEvent,
988 event_factory_.GetWeakPtr())); 988 event_factory_.GetWeakPtr()));
989 } 989 }
990 990
991 void RootWindow::SynthesizeMouseMoveEvent() { 991 void RootWindow::SynthesizeMouseMoveEvent() {
992 if (!synthesize_mouse_move_) 992 if (!synthesize_mouse_move_)
993 return; 993 return;
994 synthesize_mouse_move_ = false; 994 synthesize_mouse_move_ = false;
995 #if !defined(OS_WIN)
996 // Temporarily disabled for windows. See crbug.com/112222.
997 gfx::Point3F point(GetLastMouseLocationInRoot()); 995 gfx::Point3F point(GetLastMouseLocationInRoot());
998 float scale = ui::GetDeviceScaleFactor(layer()); 996 float scale = ui::GetDeviceScaleFactor(layer());
999 gfx::Transform transform; 997 gfx::Transform transform;
1000 transform.Scale(scale, scale); 998 transform.Scale(scale, scale);
1001 transform *= layer()->transform(); 999 transform *= layer()->transform();
1002 transform.TransformPoint(point); 1000 transform.TransformPoint(point);
1003 gfx::Point orig_mouse_location = gfx::ToFlooredPoint(point.AsPointF()); 1001 gfx::Point orig_mouse_location = gfx::ToFlooredPoint(point.AsPointF());
1004 1002
1005 // TODO(derat|oshima): Don't use mouse_button_flags_ as it's 1003 // TODO(derat|oshima): Don't use mouse_button_flags_ as it's
1006 // currently broken. See/ crbug.com/107931. 1004 // currently broken. See/ crbug.com/107931.
1007 ui::MouseEvent event(ui::ET_MOUSE_MOVED, 1005 ui::MouseEvent event(ui::ET_MOUSE_MOVED,
1008 orig_mouse_location, 1006 orig_mouse_location,
1009 orig_mouse_location, 1007 orig_mouse_location,
1010 ui::EF_IS_SYNTHESIZED); 1008 ui::EF_IS_SYNTHESIZED);
1011 event.set_system_location(Env::GetInstance()->last_mouse_location()); 1009 event.set_system_location(Env::GetInstance()->last_mouse_location());
1012 OnHostMouseEvent(&event); 1010 OnHostMouseEvent(&event);
1013 #endif
1014 } 1011 }
1015 1012
1016 } // namespace aura 1013 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698