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/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 return consumer ? static_cast<Window*>(consumer) : NULL; | 44 return consumer ? static_cast<Window*>(consumer) : NULL; |
45 } | 45 } |
46 | 46 |
47 void SetLastMouseLocation(const Window* root_window, | 47 void SetLastMouseLocation(const Window* root_window, |
48 const gfx::Point& location_in_root) { | 48 const gfx::Point& location_in_root) { |
49 client::ScreenPositionClient* client = | 49 client::ScreenPositionClient* client = |
50 client::GetScreenPositionClient(root_window); | 50 client::GetScreenPositionClient(root_window); |
51 if (client) { | 51 if (client) { |
52 gfx::Point location_in_screen = location_in_root; | 52 gfx::Point location_in_screen = location_in_root; |
53 client->ConvertPointToScreen(root_window, &location_in_screen); | 53 client->ConvertPointToScreen(root_window, &location_in_screen); |
54 Env::GetInstance()->set_last_mouse_location(location_in_screen); | 54 Env::GetInstance()->SetLastMouseLocation(location_in_screen); |
55 } else { | 55 } else { |
56 Env::GetInstance()->set_last_mouse_location(location_in_root); | 56 Env::GetInstance()->SetLastMouseLocation(location_in_root); |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 bool IsEventCandidateForHold(const ui::Event& event) { | 60 bool IsEventCandidateForHold(const ui::Event& event) { |
61 if (event.type() == ui::ET_TOUCH_MOVED) | 61 if (event.type() == ui::ET_TOUCH_MOVED) |
62 return true; | 62 return true; |
63 if (event.type() == ui::ET_MOUSE_DRAGGED) | 63 if (event.type() == ui::ET_MOUSE_DRAGGED) |
64 return true; | 64 return true; |
65 if (event.IsMouseEvent() && (event.flags() & ui::EF_IS_SYNTHESIZED)) | 65 if (event.IsMouseEvent() && (event.flags() & ui::EF_IS_SYNTHESIZED)) |
66 return true; | 66 return true; |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 } | 896 } |
897 | 897 |
898 // This flag is set depending on the gestures recognized in the call above, | 898 // This flag is set depending on the gestures recognized in the call above, |
899 // and needs to propagate with the forwarded event. | 899 // and needs to propagate with the forwarded event. |
900 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); | 900 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); |
901 | 901 |
902 PreDispatchLocatedEvent(target, event); | 902 PreDispatchLocatedEvent(target, event); |
903 } | 903 } |
904 | 904 |
905 } // namespace aura | 905 } // namespace aura |
OLD | NEW |