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

Side by Side Diff: ui/aura/test/event_generator.cc

Issue 12423007: Short term workaround to deal with calculation error caused by inverted matrix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix argument order Created 7 years, 9 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 | « ui/aura/root_window_unittest.cc ('k') | ui/base/events/event.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/test/event_generator.h" 5 #include "ui/aura/test/event_generator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "ui/aura/client/screen_position_client.h" 10 #include "ui/aura/client/screen_position_client.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 gfx::Vector2dF diff(point - current_location_); 150 gfx::Vector2dF diff(point - current_location_);
151 for (float i = 1; i <= count; i++) { 151 for (float i = 1; i <= count; i++) {
152 gfx::Vector2dF step(diff); 152 gfx::Vector2dF step(diff);
153 step.Scale(i / count); 153 step.Scale(i / count);
154 gfx::Point move_point = current_location_ + gfx::ToRoundedVector2d(step); 154 gfx::Point move_point = current_location_ + gfx::ToRoundedVector2d(step);
155 if (!grab_) 155 if (!grab_)
156 UpdateCurrentRootWindow(move_point); 156 UpdateCurrentRootWindow(move_point);
157 ConvertPointToTarget(current_root_window_, &move_point); 157 ConvertPointToTarget(current_root_window_, &move_point);
158 ui::MouseEvent mouseev(event_type, move_point, move_point, flags_); 158 ui::MouseEvent mouseev(event_type, move_point, move_point, flags_);
159 mouseev.set_system_location(move_point);
159 Dispatch(&mouseev); 160 Dispatch(&mouseev);
160 } 161 }
161 current_location_ = point; 162 current_location_ = point;
162 } 163 }
163 164
164 void EventGenerator::MoveMouseRelativeTo(const Window* window, 165 void EventGenerator::MoveMouseRelativeTo(const Window* window,
165 const gfx::Point& point_in_parent) { 166 const gfx::Point& point_in_parent) {
166 gfx::Point point(point_in_parent); 167 gfx::Point point(point_in_parent);
167 ConvertPointFromTarget(window, &point); 168 ConvertPointFromTarget(window, &point);
168 MoveMouseTo(point); 169 MoveMouseTo(point);
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 base::MessageLoopProxy::current()->PostTask( 535 base::MessageLoopProxy::current()->PostTask(
535 FROM_HERE, 536 FROM_HERE,
536 base::Bind(&EventGenerator::DispatchNextPendingEvent, 537 base::Bind(&EventGenerator::DispatchNextPendingEvent,
537 base::Unretained(this))); 538 base::Unretained(this)));
538 } 539 }
539 } 540 }
540 541
541 542
542 } // namespace test 543 } // namespace test
543 } // namespace aura 544 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/root_window_unittest.cc ('k') | ui/base/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698