Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 2844823002: Support Coalesced Touch in ppapi (Closed)
Patch Set: Support Coalesced Touch in ppapi Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 = false;
1126 for (size_t i = 0; i < event.CoalescedEventSize(); ++i) {
1127 result |= HandleInputEvent(event.CoalescedEvent(i), cursor_info);
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 (!render_frame_) 1140 if (!render_frame_)
1124 return false; 1141 return false;
1125 1142
1126 if (!has_been_clicked_ && is_flash_plugin_ && 1143 if (!has_been_clicked_ && is_flash_plugin_ &&
1127 event.GetType() == blink::WebInputEvent::kMouseDown && 1144 event.GetType() == blink::WebInputEvent::kMouseDown &&
(...skipping 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after
3473 const cc::TextureMailbox& mailbox) const { 3490 const cc::TextureMailbox& mailbox) const {
3474 auto it = 3491 auto it =
3475 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3492 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3476 [&mailbox](const TextureMailboxRefCount& ref_count) { 3493 [&mailbox](const TextureMailboxRefCount& ref_count) {
3477 return ref_count.first.mailbox() == mailbox.mailbox(); 3494 return ref_count.first.mailbox() == mailbox.mailbox();
3478 }); 3495 });
3479 return it != texture_ref_counts_.end(); 3496 return it != texture_ref_counts_.end();
3480 } 3497 }
3481 3498
3482 } // namespace content 3499 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | content/renderer/pepper/pepper_webplugin_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698