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 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { | 1020 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { |
1021 ForwardMouseEventWithLatencyInfo(mouse_event, | 1021 ForwardMouseEventWithLatencyInfo(mouse_event, |
1022 ui::LatencyInfo(ui::SourceEventType::OTHER)); | 1022 ui::LatencyInfo(ui::SourceEventType::OTHER)); |
1023 if (owner_delegate_) | 1023 if (owner_delegate_) |
1024 owner_delegate_->RenderWidgetDidForwardMouseEvent(mouse_event); | 1024 owner_delegate_->RenderWidgetDidForwardMouseEvent(mouse_event); |
1025 } | 1025 } |
1026 | 1026 |
1027 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( | 1027 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( |
1028 const blink::WebMouseEvent& mouse_event, | 1028 const blink::WebMouseEvent& mouse_event, |
1029 const ui::LatencyInfo& ui_latency) { | 1029 const ui::LatencyInfo& ui_latency) { |
1030 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", | 1030 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", "x", |
1031 "x", mouse_event.x, "y", mouse_event.y); | 1031 mouse_event.positionInWidget().x, "y", |
| 1032 mouse_event.positionInWidget().y); |
1032 | 1033 |
1033 for (size_t i = 0; i < mouse_event_callbacks_.size(); ++i) { | 1034 for (size_t i = 0; i < mouse_event_callbacks_.size(); ++i) { |
1034 if (mouse_event_callbacks_[i].Run(mouse_event)) | 1035 if (mouse_event_callbacks_[i].Run(mouse_event)) |
1035 return; | 1036 return; |
1036 } | 1037 } |
1037 | 1038 |
1038 if (ShouldDropInputEvents()) | 1039 if (ShouldDropInputEvents()) |
1039 return; | 1040 return; |
1040 | 1041 |
1041 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) | 1042 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) |
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 RenderProcessHost* rph = GetProcess(); | 2712 RenderProcessHost* rph = GetProcess(); |
2712 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); | 2713 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); |
2713 i != messages.end(); ++i) { | 2714 i != messages.end(); ++i) { |
2714 rph->OnMessageReceived(*i); | 2715 rph->OnMessageReceived(*i); |
2715 if (i->dispatch_error()) | 2716 if (i->dispatch_error()) |
2716 rph->OnBadMessageReceived(*i); | 2717 rph->OnBadMessageReceived(*i); |
2717 } | 2718 } |
2718 } | 2719 } |
2719 | 2720 |
2720 } // namespace content | 2721 } // namespace content |
OLD | NEW |