| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/window_event_dispatcher.h" | 5 #include "ui/aura/window_event_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } else { | 381 } else { |
| 382 // Make sure mouse_moved_handler gets updated. | 382 // Make sure mouse_moved_handler gets updated. |
| 383 DispatchDetails details = SynthesizeMouseMoveEvent(); | 383 DispatchDetails details = SynthesizeMouseMoveEvent(); |
| 384 if (details.dispatcher_destroyed) | 384 if (details.dispatcher_destroyed) |
| 385 return; | 385 return; |
| 386 } | 386 } |
| 387 mouse_pressed_handler_ = NULL; | 387 mouse_pressed_handler_ = NULL; |
| 388 } | 388 } |
| 389 | 389 |
| 390 void WindowEventDispatcher::OnOtherRootGotCapture() { | 390 void WindowEventDispatcher::OnOtherRootGotCapture() { |
| 391 // Sending the mouse exit causes bugs on Windows (e.g. crbug.com/394672). |
| 392 // TODO(pkotwicz): Fix the bugs and send mouse exit on Windows too. |
| 393 #if !defined(OS_WIN) |
| 391 if (mouse_moved_handler_) { | 394 if (mouse_moved_handler_) { |
| 392 // Dispatch a mouse exit to reset any state associated with hover. This is | 395 // Dispatch a mouse exit to reset any state associated with hover. This is |
| 393 // important when going from no window having capture to a window having | 396 // important when going from no window having capture to a window having |
| 394 // capture because we do not dispatch ET_MOUSE_CAPTURE_CHANGED in this case. | 397 // capture because we do not dispatch ET_MOUSE_CAPTURE_CHANGED in this case. |
| 395 DispatchDetails details = DispatchMouseExitAtPoint( | 398 DispatchDetails details = DispatchMouseExitAtPoint( |
| 396 GetLastMouseLocationInRoot()); | 399 GetLastMouseLocationInRoot()); |
| 397 if (details.dispatcher_destroyed) | 400 if (details.dispatcher_destroyed) |
| 398 return; | 401 return; |
| 399 } | 402 } |
| 403 #endif |
| 400 | 404 |
| 401 mouse_moved_handler_ = NULL; | 405 mouse_moved_handler_ = NULL; |
| 402 mouse_pressed_handler_ = NULL; | 406 mouse_pressed_handler_ = NULL; |
| 403 } | 407 } |
| 404 | 408 |
| 405 void WindowEventDispatcher::SetNativeCapture() { | 409 void WindowEventDispatcher::SetNativeCapture() { |
| 406 host_->SetCapture(); | 410 host_->SetCapture(); |
| 407 } | 411 } |
| 408 | 412 |
| 409 void WindowEventDispatcher::ReleaseNativeCapture() { | 413 void WindowEventDispatcher::ReleaseNativeCapture() { |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 break; | 867 break; |
| 864 | 868 |
| 865 default: | 869 default: |
| 866 NOTREACHED(); | 870 NOTREACHED(); |
| 867 break; | 871 break; |
| 868 } | 872 } |
| 869 PreDispatchLocatedEvent(target, event); | 873 PreDispatchLocatedEvent(target, event); |
| 870 } | 874 } |
| 871 | 875 |
| 872 } // namespace aura | 876 } // namespace aura |
| OLD | NEW |