| 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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { | 1018 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { |
| 1019 ForwardMouseEventWithLatencyInfo(mouse_event, | 1019 ForwardMouseEventWithLatencyInfo(mouse_event, |
| 1020 ui::LatencyInfo(ui::SourceEventType::OTHER)); | 1020 ui::LatencyInfo(ui::SourceEventType::OTHER)); |
| 1021 if (owner_delegate_) | 1021 if (owner_delegate_) |
| 1022 owner_delegate_->RenderWidgetDidForwardMouseEvent(mouse_event); | 1022 owner_delegate_->RenderWidgetDidForwardMouseEvent(mouse_event); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( | 1025 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( |
| 1026 const blink::WebMouseEvent& mouse_event, | 1026 const blink::WebMouseEvent& mouse_event, |
| 1027 const ui::LatencyInfo& ui_latency) { | 1027 const ui::LatencyInfo& ui_latency) { |
| 1028 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", | 1028 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", "x", |
| 1029 "x", mouse_event.x, "y", mouse_event.y); | 1029 mouse_event.positionInWidget().x, "y", |
| 1030 mouse_event.positionInWidget().y); |
| 1030 | 1031 |
| 1031 for (size_t i = 0; i < mouse_event_callbacks_.size(); ++i) { | 1032 for (size_t i = 0; i < mouse_event_callbacks_.size(); ++i) { |
| 1032 if (mouse_event_callbacks_[i].Run(mouse_event)) | 1033 if (mouse_event_callbacks_[i].Run(mouse_event)) |
| 1033 return; | 1034 return; |
| 1034 } | 1035 } |
| 1035 | 1036 |
| 1036 if (ShouldDropInputEvents()) | 1037 if (ShouldDropInputEvents()) |
| 1037 return; | 1038 return; |
| 1038 | 1039 |
| 1039 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) | 1040 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) |
| (...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2655 | 2656 |
| 2656 // After navigation, if a frame belonging to the new page is received, stop | 2657 // After navigation, if a frame belonging to the new page is received, stop |
| 2657 // the timer that triggers clearing the graphics of the last page. | 2658 // the timer that triggers clearing the graphics of the last page. |
| 2658 if (last_received_content_source_id_ >= current_content_source_id_ && | 2659 if (last_received_content_source_id_ >= current_content_source_id_ && |
| 2659 new_content_rendering_timeout_->IsRunning()) { | 2660 new_content_rendering_timeout_->IsRunning()) { |
| 2660 new_content_rendering_timeout_->Stop(); | 2661 new_content_rendering_timeout_->Stop(); |
| 2661 } | 2662 } |
| 2662 } | 2663 } |
| 2663 | 2664 |
| 2664 } // namespace content | 2665 } // namespace content |
| OLD | NEW |