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

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

Issue 2479123003: WIP Add getCoalescedEvents API using vector of WebInputEvents (Closed)
Patch Set: Creating CoalescedWebInputEvent Created 4 years, 1 month 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 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after
2206 if (handled) 2206 if (handled)
2207 return; 2207 return;
2208 2208
2209 std::vector<std::unique_ptr<WebInputEvent>> events = 2209 std::vector<std::unique_ptr<WebInputEvent>> events =
2210 CreateSimulatedWebInputEvents( 2210 CreateSimulatedWebInputEvents(
2211 input_event, view_data_.rect.point.x + view_data_.rect.size.width / 2, 2211 input_event, view_data_.rect.point.x + view_data_.rect.size.width / 2,
2212 view_data_.rect.point.y + view_data_.rect.size.height / 2); 2212 view_data_.rect.point.y + view_data_.rect.size.height / 2);
2213 for (std::vector<std::unique_ptr<WebInputEvent>>::iterator it = 2213 for (std::vector<std::unique_ptr<WebInputEvent>>::iterator it =
2214 events.begin(); 2214 events.begin();
2215 it != events.end(); ++it) { 2215 it != events.end(); ++it) {
2216 widget->handleInputEvent(*it->get()); 2216 widget->handleInputEvent(CoalescedWebInputEvent(*it->get()));
2217 } 2217 }
2218 } 2218 }
2219 2219
2220 bool PepperPluginInstanceImpl::SimulateIMEEvent( 2220 bool PepperPluginInstanceImpl::SimulateIMEEvent(
2221 const InputEventData& input_event) { 2221 const InputEventData& input_event) {
2222 switch (input_event.event_type) { 2222 switch (input_event.event_type) {
2223 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_START: 2223 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_START:
2224 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE: 2224 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE:
2225 SimulateImeSetCompositionEvent(input_event); 2225 SimulateImeSetCompositionEvent(input_event);
2226 break; 2226 break;
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
3436 const cc::TextureMailbox& mailbox) const { 3436 const cc::TextureMailbox& mailbox) const {
3437 auto it = 3437 auto it =
3438 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3438 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3439 [&mailbox](const TextureMailboxRefCount& ref_count) { 3439 [&mailbox](const TextureMailboxRefCount& ref_count) {
3440 return ref_count.first.mailbox() == mailbox.mailbox(); 3440 return ref_count.first.mailbox() == mailbox.mailbox();
3441 }); 3441 });
3442 return it != texture_ref_counts_.end(); 3442 return it != texture_ref_counts_.end();
3443 } 3443 }
3444 3444
3445 } // namespace content 3445 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698