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

Side by Side Diff: content/browser/devtools/protocol/input_handler.cc

Issue 2576013002: Introducing WebCoalescedInputEvent and inclusion in content/common (Closed)
Patch Set: Fix a few DCHECK hits Created 3 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/devtools/protocol/input_handler.h" 5 #include "content/browser/devtools/protocol/input_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 base::StringPrintf("Unexpected event type '%s'", type.c_str())); 358 base::StringPrintf("Unexpected event type '%s'", type.c_str()));
359 } 359 }
360 } 360 }
361 361
362 blink::WebPointerProperties::Button event_button = 362 blink::WebPointerProperties::Button event_button =
363 blink::WebPointerProperties::Button::NoButton; 363 blink::WebPointerProperties::Button::NoButton;
364 int button_modifiers = 0; 364 int button_modifiers = 0;
365 if (!GetMouseEventButton(button, &event_button, &button_modifiers)) 365 if (!GetMouseEventButton(button, &event_button, &button_modifiers))
366 return Response::InvalidParams("Invalid mouse button"); 366 return Response::InvalidParams("Invalid mouse button");
367 367
368 ui::ScopedWebInputEvent event; 368 blink::WebScopedInputEvent event;
369 blink::WebMouseWheelEvent* wheel_event = nullptr; 369 blink::WebMouseWheelEvent* wheel_event = nullptr;
370 blink::WebMouseEvent* mouse_event = nullptr; 370 blink::WebMouseEvent* mouse_event = nullptr;
371 if (type == Input::EmulateTouchFromMouseEvent::TypeEnum::MouseWheel) { 371 if (type == Input::EmulateTouchFromMouseEvent::TypeEnum::MouseWheel) {
372 wheel_event = new blink::WebMouseWheelEvent( 372 wheel_event = new blink::WebMouseWheelEvent(
373 event_type, GetEventModifiers( 373 event_type, GetEventModifiers(
374 modifiers.fromMaybe(blink::WebInputEvent::NoModifiers), 374 modifiers.fromMaybe(blink::WebInputEvent::NoModifiers),
375 false, false) | 375 false, false) |
376 button_modifiers, 376 button_modifiers,
377 GetEventTimestamp(timestamp)); 377 GetEventTimestamp(timestamp));
378 mouse_event = wheel_event; 378 mouse_event = wheel_event;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 for (int i = 0; i < count; i++) { 582 for (int i = 0; i < count; i++) {
583 host_->GetRenderWidgetHost()->QueueSyntheticGesture( 583 host_->GetRenderWidgetHost()->QueueSyntheticGesture(
584 SyntheticGesture::Create(gesture_params), 584 SyntheticGesture::Create(gesture_params),
585 base::Bind(&TapGestureResponse::OnGestureResult, 585 base::Bind(&TapGestureResponse::OnGestureResult,
586 base::Unretained(response))); 586 base::Unretained(response)));
587 } 587 }
588 } 588 }
589 589
590 } // namespace protocol 590 } // namespace protocol
591 } // namespace content 591 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698