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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 1254883006: Bubble scroll events from WebView guest to embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Complete test. Created 5 years, 4 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 "base/bind_helpers.h" 5 #include "base/bind_helpers.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/surfaces/surface.h" 9 #include "cc/surfaces/surface.h"
10 #include "cc/surfaces/surface_factory.h" 10 #include "cc/surfaces/surface_factory.h"
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 return; 656 return;
657 } 657 }
658 658
659 if (blink::WebInputEvent::isGestureEventType(event->type)) { 659 if (blink::WebInputEvent::isGestureEventType(event->type)) {
660 host_->ForwardGestureEvent( 660 host_->ForwardGestureEvent(
661 *static_cast<const blink::WebGestureEvent*>(event)); 661 *static_cast<const blink::WebGestureEvent*>(event));
662 return; 662 return;
663 } 663 }
664 } 664 }
665 665
666 namespace {
667
668 bool IsScrollEvent(const blink::WebInputEvent& event) {
669 return event.type == blink::WebInputEvent::GestureScrollBegin ||
670 event.type == blink::WebInputEvent::GestureScrollUpdate ||
671 event.type == blink::WebInputEvent::GestureScrollEnd ||
672 event.type == blink::WebInputEvent::MouseWheel;
673 }
674
675 } // namespace
676
677 void RenderWidgetHostViewGuest::GestureEventAck(
678 const blink::WebGestureEvent& event,
679 InputEventAckState ack_result) {
680 if (IsScrollEvent(event))
681 guest_->SendScrollCompletion(ack_result == INPUT_EVENT_ACK_STATE_CONSUMED);
682 }
683
684 void RenderWidgetHostViewGuest::WheelEventAck(
685 const blink::WebMouseWheelEvent& event,
686 InputEventAckState ack_result) {
687 if (IsScrollEvent(event))
688 guest_->SendScrollCompletion(ack_result == INPUT_EVENT_ACK_STATE_CONSUMED);
689 }
690
666 } // namespace content 691 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_widget_host_view_guest.h ('k') | content/common/browser_plugin/browser_plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698