OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { | 1003 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { |
1004 ForwardMouseEventWithLatencyInfo(mouse_event, | 1004 ForwardMouseEventWithLatencyInfo(mouse_event, |
1005 ui::LatencyInfo(ui::SourceEventType::OTHER)); | 1005 ui::LatencyInfo(ui::SourceEventType::OTHER)); |
1006 if (owner_delegate_) | 1006 if (owner_delegate_) |
1007 owner_delegate_->RenderWidgetDidForwardMouseEvent(mouse_event); | 1007 owner_delegate_->RenderWidgetDidForwardMouseEvent(mouse_event); |
1008 } | 1008 } |
1009 | 1009 |
1010 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( | 1010 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( |
1011 const blink::WebMouseEvent& mouse_event, | 1011 const blink::WebMouseEvent& mouse_event, |
1012 const ui::LatencyInfo& ui_latency) { | 1012 const ui::LatencyInfo& ui_latency) { |
1013 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", | 1013 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", "x", |
1014 "x", mouse_event.x, "y", mouse_event.y); | 1014 mouse_event.positionInWidget().x, "y", |
| 1015 mouse_event.positionInWidget().y); |
1015 | 1016 |
1016 for (size_t i = 0; i < mouse_event_callbacks_.size(); ++i) { | 1017 for (size_t i = 0; i < mouse_event_callbacks_.size(); ++i) { |
1017 if (mouse_event_callbacks_[i].Run(mouse_event)) | 1018 if (mouse_event_callbacks_[i].Run(mouse_event)) |
1018 return; | 1019 return; |
1019 } | 1020 } |
1020 | 1021 |
1021 if (ShouldDropInputEvents()) | 1022 if (ShouldDropInputEvents()) |
1022 return; | 1023 return; |
1023 | 1024 |
1024 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) | 1025 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) |
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2640 | 2641 |
2641 // After navigation, if a frame belonging to the new page is received, stop | 2642 // After navigation, if a frame belonging to the new page is received, stop |
2642 // the timer that triggers clearing the graphics of the last page. | 2643 // the timer that triggers clearing the graphics of the last page. |
2643 if (last_received_content_source_id_ >= current_content_source_id_ && | 2644 if (last_received_content_source_id_ >= current_content_source_id_ && |
2644 new_content_rendering_timeout_->IsRunning()) { | 2645 new_content_rendering_timeout_->IsRunning()) { |
2645 new_content_rendering_timeout_->Stop(); | 2646 new_content_rendering_timeout_->Stop(); |
2646 } | 2647 } |
2647 } | 2648 } |
2648 | 2649 |
2649 } // namespace content | 2650 } // namespace content |
OLD | NEW |