Chromium Code Reviews| 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/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bit_cast.h" | 10 #include "base/bit_cast.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 #include "ppapi/shared_impl/scoped_pp_resource.h" | 90 #include "ppapi/shared_impl/scoped_pp_resource.h" |
| 91 #include "ppapi/shared_impl/scoped_pp_var.h" | 91 #include "ppapi/shared_impl/scoped_pp_var.h" |
| 92 #include "ppapi/shared_impl/time_conversion.h" | 92 #include "ppapi/shared_impl/time_conversion.h" |
| 93 #include "ppapi/shared_impl/url_request_info_data.h" | 93 #include "ppapi/shared_impl/url_request_info_data.h" |
| 94 #include "ppapi/shared_impl/var.h" | 94 #include "ppapi/shared_impl/var.h" |
| 95 #include "ppapi/thunk/enter.h" | 95 #include "ppapi/thunk/enter.h" |
| 96 #include "ppapi/thunk/ppb_buffer_api.h" | 96 #include "ppapi/thunk/ppb_buffer_api.h" |
| 97 #include "printing/features/features.h" | 97 #include "printing/features/features.h" |
| 98 #include "skia/ext/platform_canvas.h" | 98 #include "skia/ext/platform_canvas.h" |
| 99 #include "third_party/WebKit/public/platform/URLConversion.h" | 99 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 100 #include "third_party/WebKit/public/platform/WebCoalescedInputEvent.h" | |
| 100 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 101 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
| 101 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 102 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
| 102 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 103 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
| 103 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" | 104 #include "third_party/WebKit/public/platform/WebKeyboardEvent.h" |
| 104 #include "third_party/WebKit/public/platform/WebMouseEvent.h" | 105 #include "third_party/WebKit/public/platform/WebMouseEvent.h" |
| 105 #include "third_party/WebKit/public/platform/WebRect.h" | 106 #include "third_party/WebKit/public/platform/WebRect.h" |
| 106 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 107 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 107 #include "third_party/WebKit/public/platform/WebString.h" | 108 #include "third_party/WebKit/public/platform/WebString.h" |
| 108 #include "third_party/WebKit/public/platform/WebURL.h" | 109 #include "third_party/WebKit/public/platform/WebURL.h" |
| 109 #include "third_party/WebKit/public/platform/WebURLError.h" | 110 #include "third_party/WebKit/public/platform/WebURLError.h" |
| (...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1108 // some platforms, an "exclude rectangle" where candidate window | 1109 // some platforms, an "exclude rectangle" where candidate window |
| 1109 // must avoid the region can be passed to IME. Currently, we pass | 1110 // must avoid the region can be passed to IME. Currently, we pass |
| 1110 // only the caret rectangle because it is the only information | 1111 // only the caret rectangle because it is the only information |
| 1111 // supported uniformly in Chromium. | 1112 // supported uniformly in Chromium. |
| 1112 gfx::Rect caret(text_input_caret_); | 1113 gfx::Rect caret(text_input_caret_); |
| 1113 caret.Offset(view_data_.rect.point.x, view_data_.rect.point.y); | 1114 caret.Offset(view_data_.rect.point.x, view_data_.rect.point.y); |
| 1114 ConvertDIPToViewport(&caret); | 1115 ConvertDIPToViewport(&caret); |
| 1115 return caret; | 1116 return caret; |
| 1116 } | 1117 } |
| 1117 | 1118 |
| 1119 bool PepperPluginInstanceImpl::HandleCoalescedInputEvent( | |
| 1120 const blink::WebCoalescedInputEvent& event, | |
| 1121 WebCursorInfo* cursor_info) { | |
| 1122 if (blink::WebInputEvent::IsTouchEventType(event.Event().GetType()) && | |
| 1123 ((filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_COALESCED_TOUCH) || | |
| 1124 (input_event_mask_ & PP_INPUTEVENT_CLASS_COALESCED_TOUCH))) { | |
| 1125 bool result; | |
|
dtapuska
2017/05/05 16:21:09
Probably need to initialize result?
jkwang
2017/05/05 20:21:43
Done.
| |
| 1126 for (size_t i = 0; i < event.CoalescedEventSize(); ++i) { | |
| 1127 result = HandleInputEvent(event.CoalescedEvent(i), cursor_info); | |
|
dtapuska
2017/05/05 16:21:09
Should this be an |= ? Probably if any is handled
jkwang
2017/05/05 20:21:43
Done.
| |
| 1128 } | |
| 1129 return result; | |
| 1130 } else { | |
| 1131 return HandleInputEvent(event.Event(), cursor_info); | |
| 1132 } | |
| 1133 } | |
| 1134 | |
| 1118 bool PepperPluginInstanceImpl::HandleInputEvent( | 1135 bool PepperPluginInstanceImpl::HandleInputEvent( |
| 1119 const blink::WebInputEvent& event, | 1136 const blink::WebInputEvent& event, |
| 1120 WebCursorInfo* cursor_info) { | 1137 WebCursorInfo* cursor_info) { |
| 1121 TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::HandleInputEvent"); | 1138 TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::HandleInputEvent"); |
| 1122 | 1139 |
| 1123 if (!has_been_clicked_ && is_flash_plugin_ && | 1140 if (!has_been_clicked_ && is_flash_plugin_ && |
| 1124 event.GetType() == blink::WebInputEvent::kMouseDown && | 1141 event.GetType() == blink::WebInputEvent::kMouseDown && |
| 1125 (event.GetModifiers() & blink::WebInputEvent::kLeftButtonDown)) { | 1142 (event.GetModifiers() & blink::WebInputEvent::kLeftButtonDown)) { |
| 1126 has_been_clicked_ = true; | 1143 has_been_clicked_ = true; |
| 1127 blink::WebRect bounds = container()->GetElement().BoundsInViewport(); | 1144 blink::WebRect bounds = container()->GetElement().BoundsInViewport(); |
| (...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3453 const cc::TextureMailbox& mailbox) const { | 3470 const cc::TextureMailbox& mailbox) const { |
| 3454 auto it = | 3471 auto it = |
| 3455 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), | 3472 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), |
| 3456 [&mailbox](const TextureMailboxRefCount& ref_count) { | 3473 [&mailbox](const TextureMailboxRefCount& ref_count) { |
| 3457 return ref_count.first.mailbox() == mailbox.mailbox(); | 3474 return ref_count.first.mailbox() == mailbox.mailbox(); |
| 3458 }); | 3475 }); |
| 3459 return it != texture_ref_counts_.end(); | 3476 return it != texture_ref_counts_.end(); |
| 3460 } | 3477 } |
| 3461 | 3478 |
| 3462 } // namespace content | 3479 } // namespace content |
| OLD | NEW |