Chromium Code Reviews| Index: ui/aura/root_window.cc |
| diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc |
| index 8cecf479e11c533bca70c1412e514d4790397deb..3afd448d8ca8d1a98a16b9cb65cc3536ca422abf 100644 |
| --- a/ui/aura/root_window.cc |
| +++ b/ui/aura/root_window.cc |
| @@ -149,6 +149,7 @@ RootWindow::RootWindow(const CreateParams& params) |
| event_factory_(this), |
| held_event_factory_(this), |
| repostable_event_factory_(this) { |
| + set_dispatcher(this); |
|
sky
2013/10/24 20:59:46
You need to set this to NULL in the destructor, ot
|
| SetName("RootWindow"); |
| compositor_.reset(new ui::Compositor(host_->GetAcceleratedWidget())); |
| @@ -613,7 +614,7 @@ void RootWindow::OnWindowAddedToRootWindow(Window* attached) { |
| } |
| void RootWindow::OnWindowRemovedFromRootWindow(Window* detached, |
| - RootWindow* new_root) { |
| + Window* new_root) { |
| DCHECK(aura::client::GetCaptureWindow(this) != this); |
| DispatchMouseExitToHidingWindow(detached); |
| @@ -932,15 +933,15 @@ void RootWindow::DispatchMouseEventRepost(ui::MouseEvent* event) { |
| if (event->type() != ui::ET_MOUSE_PRESSED) |
| return; |
| Window* target = client::GetCaptureWindow(this); |
| - RootWindow* root = this; |
| + WindowEventDispatcher* dispatcher = this; |
| if (!target) { |
| target = GetEventHandlerForPoint(event->location()); |
| } else { |
| - root = target->GetRootWindow(); |
| - CHECK(root); // Capture window better be in valid root. |
| + dispatcher = target->GetDispatcher(); |
| + CHECK(dispatcher); // Capture window better be in valid root. |
| } |
| - root->mouse_pressed_handler_ = NULL; |
| - root->DispatchMouseEventToTarget(event, target); |
| + dispatcher->mouse_pressed_handler_ = NULL; |
| + dispatcher->DispatchMouseEventToTarget(event, target); |
| } |
| bool RootWindow::DispatchMouseEventToTarget(ui::MouseEvent* event, |