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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 return; | 577 return; |
578 | 578 |
579 if (window == host_->window()) { | 579 if (window == host_->window()) { |
580 TRACE_EVENT1("ui", "WindowEventDispatcher::OnWindowBoundsChanged(root)", | 580 TRACE_EVENT1("ui", "WindowEventDispatcher::OnWindowBoundsChanged(root)", |
581 "size", new_bounds.size().ToString()); | 581 "size", new_bounds.size().ToString()); |
582 | 582 |
583 DispatchDetails details = DispatchHeldEvents(); | 583 DispatchDetails details = DispatchHeldEvents(); |
584 if (details.dispatcher_destroyed) | 584 if (details.dispatcher_destroyed) |
585 return; | 585 return; |
586 | 586 |
587 // Constrain the mouse position within the new root Window size. | |
588 gfx::Point point; | |
589 if (host_->QueryMouseLocation(&point)) { | |
590 SetLastMouseLocation( | |
591 host_->window(), | |
592 ui::ConvertPointToDIP(host_->window()->layer(), point)); | |
593 } | |
594 synthesize_mouse_move_ = false; | 587 synthesize_mouse_move_ = false; |
595 } | 588 } |
596 | 589 |
597 if (window->IsVisible() && !window->ignore_events()) { | 590 if (window->IsVisible() && !window->ignore_events()) { |
598 gfx::Rect old_bounds_in_root = old_bounds, new_bounds_in_root = new_bounds; | 591 gfx::Rect old_bounds_in_root = old_bounds, new_bounds_in_root = new_bounds; |
599 Window::ConvertRectToTarget(window->parent(), host_->window(), | 592 Window::ConvertRectToTarget(window->parent(), host_->window(), |
600 &old_bounds_in_root); | 593 &old_bounds_in_root); |
601 Window::ConvertRectToTarget(window->parent(), host_->window(), | 594 Window::ConvertRectToTarget(window->parent(), host_->window(), |
602 &new_bounds_in_root); | 595 &new_bounds_in_root); |
603 gfx::Point last_mouse_location = GetLastMouseLocationInRoot(); | 596 gfx::Point last_mouse_location = GetLastMouseLocationInRoot(); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 break; | 849 break; |
857 | 850 |
858 default: | 851 default: |
859 NOTREACHED(); | 852 NOTREACHED(); |
860 break; | 853 break; |
861 } | 854 } |
862 PreDispatchLocatedEvent(target, event); | 855 PreDispatchLocatedEvent(target, event); |
863 } | 856 } |
864 | 857 |
865 } // namespace aura | 858 } // namespace aura |
OLD | NEW |