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

Unified Diff: ui/aura/test/event_generator.cc

Issue 191153004: Provide access to the WindowEventDispatcher as a ui::EventProcessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/test/event_generator.h ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/event_generator.cc
diff --git a/ui/aura/test/event_generator.cc b/ui/aura/test/event_generator.cc
index b1dcab525dddb534986cd86be5b251a7726d544e..42614f57474a1c1b22b56239ed02209bf6f8c8ac 100644
--- a/ui/aura/test/event_generator.cc
+++ b/ui/aura/test/event_generator.cc
@@ -39,9 +39,8 @@ class DefaultEventGeneratorDelegate : public EventGeneratorDelegate {
virtual ~DefaultEventGeneratorDelegate() {}
// EventGeneratorDelegate overrides:
- virtual WindowEventDispatcher* GetDispatcherAt(
- const gfx::Point& point) const OVERRIDE {
- return root_window_->GetHost()->dispatcher();
+ virtual WindowTreeHost* GetHostAt(const gfx::Point& point) const OVERRIDE {
+ return root_window_->GetHost();
}
virtual client::ScreenPositionClient* GetScreenPositionClient(
@@ -83,7 +82,7 @@ const int kAllButtonMask = ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON;
EventGenerator::EventGenerator(Window* root_window)
: delegate_(new DefaultEventGeneratorDelegate(root_window)),
- current_dispatcher_(delegate_->GetDispatcherAt(current_location_)),
+ current_host_(delegate_->GetHostAt(current_location_)),
flags_(0),
grab_(false),
async_(false) {
@@ -92,7 +91,7 @@ EventGenerator::EventGenerator(Window* root_window)
EventGenerator::EventGenerator(Window* root_window, const gfx::Point& point)
: delegate_(new DefaultEventGeneratorDelegate(root_window)),
current_location_(point),
- current_dispatcher_(delegate_->GetDispatcherAt(current_location_)),
+ current_host_(delegate_->GetHostAt(current_location_)),
flags_(0),
grab_(false),
async_(false) {
@@ -101,7 +100,7 @@ EventGenerator::EventGenerator(Window* root_window, const gfx::Point& point)
EventGenerator::EventGenerator(Window* root_window, Window* window)
: delegate_(new DefaultEventGeneratorDelegate(root_window)),
current_location_(CenterOfWindow(window)),
- current_dispatcher_(delegate_->GetDispatcherAt(current_location_)),
+ current_host_(delegate_->GetHostAt(current_location_)),
flags_(0),
grab_(false),
async_(false) {
@@ -109,7 +108,7 @@ EventGenerator::EventGenerator(Window* root_window, Window* window)
EventGenerator::EventGenerator(EventGeneratorDelegate* delegate)
: delegate_(delegate),
- current_dispatcher_(delegate_->GetDispatcherAt(current_location_)),
+ current_host_(delegate_->GetHostAt(current_location_)),
flags_(0),
grab_(false),
async_(false) {
@@ -152,7 +151,7 @@ void EventGenerator::ReleaseRightButton() {
void EventGenerator::SendMouseExit() {
gfx::Point exit_location(current_location_);
- ConvertPointToTarget(current_dispatcher_->window(), &exit_location);
+ ConvertPointToTarget(current_host_->window(), &exit_location);
ui::MouseEvent mouseev(ui::ET_MOUSE_EXITED, exit_location, exit_location,
flags_, 0);
Dispatch(&mouseev);
@@ -165,7 +164,7 @@ void EventGenerator::MoveMouseToInHost(const gfx::Point& point_in_host) {
Dispatch(&mouseev);
current_location_ = point_in_host;
- current_dispatcher_->host()->ConvertPointFromHost(&current_location_);
+ current_host_->ConvertPointFromHost(&current_location_);
}
void EventGenerator::MoveMouseTo(const gfx::Point& point_in_screen,
@@ -181,7 +180,7 @@ void EventGenerator::MoveMouseTo(const gfx::Point& point_in_screen,
gfx::Point move_point = current_location_ + gfx::ToRoundedVector2d(step);
if (!grab_)
UpdateCurrentDispatcher(move_point);
- ConvertPointToTarget(current_dispatcher_->window(), &move_point);
+ ConvertPointToTarget(current_host_->window(), &move_point);
ui::MouseEvent mouseev(event_type, move_point, move_point, flags_, 0);
Dispatch(&mouseev);
}
@@ -525,7 +524,7 @@ void EventGenerator::DispatchKeyEvent(bool is_press,
}
void EventGenerator::UpdateCurrentDispatcher(const gfx::Point& point) {
- current_dispatcher_ = delegate_->GetDispatcherAt(point);
+ current_host_ = delegate_->GetHostAt(point);
}
void EventGenerator::PressButton(int flag) {
@@ -574,7 +573,7 @@ void EventGenerator::ConvertPointToTarget(const aura::Window* target,
gfx::Point EventGenerator::GetLocationInCurrentRoot() const {
gfx::Point p(current_location_);
- ConvertPointToTarget(current_dispatcher_->window(), &p);
+ ConvertPointToTarget(current_host_->window(), &p);
return p;
}
@@ -608,8 +607,8 @@ void EventGenerator::DoDispatchEvent(ui::Event* event, bool async) {
}
pending_events_.push_back(pending_event);
} else {
- ui::EventDispatchDetails details = current_dispatcher_->OnEventFromSource(
- event);
+ ui::EventDispatchDetails details =
+ current_host_->event_processor()->OnEventFromSource(event);
CHECK(!details.dispatcher_destroyed);
}
}
« no previous file with comments | « ui/aura/test/event_generator.h ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698