| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |