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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 // |details| contains information about |mouse_moved_handler_| being | 855 // |details| contains information about |mouse_moved_handler_| being |
856 // destroyed which is not our |target|. Return value of this function | 856 // destroyed which is not our |target|. Return value of this function |
857 // should be about our |target|. | 857 // should be about our |target|. |
858 DispatchDetails target_details = details; | 858 DispatchDetails target_details = details; |
859 target_details.target_destroyed = !live_window.Contains(target); | 859 target_details.target_destroyed = !live_window.Contains(target); |
860 if (details.dispatcher_destroyed) { | 860 if (details.dispatcher_destroyed) { |
861 event->SetHandled(); | 861 event->SetHandled(); |
862 return target_details; | 862 return target_details; |
863 } | 863 } |
864 // If the |mouse_moved_handler_| changes out from under us, assume a | 864 // If the |mouse_moved_handler_| changes out from under us, assume a |
865 // nested message loop ran and we don't need to do anything. | 865 // nested run loop ran and we don't need to do anything. |
866 if (mouse_moved_handler_ != old_mouse_moved_handler) { | 866 if (mouse_moved_handler_ != old_mouse_moved_handler) { |
867 event->SetHandled(); | 867 event->SetHandled(); |
868 return target_details; | 868 return target_details; |
869 } | 869 } |
870 if (details.target_destroyed || target_details.target_destroyed) { | 870 if (details.target_destroyed || target_details.target_destroyed) { |
871 mouse_moved_handler_ = NULL; | 871 mouse_moved_handler_ = NULL; |
872 event->SetHandled(); | 872 event->SetHandled(); |
873 return target_details; | 873 return target_details; |
874 } | 874 } |
875 live_window.Remove(target); | 875 live_window.Remove(target); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 } | 923 } |
924 | 924 |
925 // This flag is set depending on the gestures recognized in the call above, | 925 // This flag is set depending on the gestures recognized in the call above, |
926 // and needs to propagate with the forwarded event. | 926 // and needs to propagate with the forwarded event. |
927 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); | 927 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); |
928 | 928 |
929 return PreDispatchLocatedEvent(target, event); | 929 return PreDispatchLocatedEvent(target, event); |
930 } | 930 } |
931 | 931 |
932 } // namespace aura | 932 } // namespace aura |
OLD | NEW |