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

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

Issue 13902003: Remove Event::system_location (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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.cc ('k') | ui/base/events/event.h » ('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/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "ui/aura/client/screen_position_client.h" 10 #include "ui/aura/client/screen_position_client.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 gfx::Vector2dF diff(point - current_location_); 153 gfx::Vector2dF diff(point - current_location_);
154 for (float i = 1; i <= count; i++) { 154 for (float i = 1; i <= count; i++) {
155 gfx::Vector2dF step(diff); 155 gfx::Vector2dF step(diff);
156 step.Scale(i / count); 156 step.Scale(i / count);
157 gfx::Point move_point = current_location_ + gfx::ToRoundedVector2d(step); 157 gfx::Point move_point = current_location_ + gfx::ToRoundedVector2d(step);
158 if (!grab_) 158 if (!grab_)
159 UpdateCurrentRootWindow(move_point); 159 UpdateCurrentRootWindow(move_point);
160 ConvertPointToTarget(current_root_window_, &move_point); 160 ConvertPointToTarget(current_root_window_, &move_point);
161 ui::MouseEvent mouseev(event_type, move_point, move_point, flags_); 161 ui::MouseEvent mouseev(event_type, move_point, move_point, flags_);
162 mouseev.set_system_location(move_point);
163 Dispatch(&mouseev); 162 Dispatch(&mouseev);
164 } 163 }
165 current_location_ = point; 164 current_location_ = point;
166 } 165 }
167 166
168 void EventGenerator::MoveMouseRelativeTo(const Window* window, 167 void EventGenerator::MoveMouseRelativeTo(const Window* window,
169 const gfx::Point& point_in_parent) { 168 const gfx::Point& point_in_parent) {
170 gfx::Point point(point_in_parent); 169 gfx::Point point(point_in_parent);
171 ConvertPointFromTarget(window, &point); 170 ConvertPointFromTarget(window, &point);
172 MoveMouseTo(point); 171 MoveMouseTo(point);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 base::MessageLoopProxy::current()->PostTask( 552 base::MessageLoopProxy::current()->PostTask(
554 FROM_HERE, 553 FROM_HERE,
555 base::Bind(&EventGenerator::DispatchNextPendingEvent, 554 base::Bind(&EventGenerator::DispatchNextPendingEvent,
556 base::Unretained(this))); 555 base::Unretained(this)));
557 } 556 }
558 } 557 }
559 558
560 559
561 } // namespace test 560 } // namespace test
562 } // namespace aura 561 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/base/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698