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

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

Issue 393953012: Eager Gesture Recognition on Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 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 | Annotate | Revision Log
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 "content/browser/browser_plugin/browser_plugin_guest.h" 9 #include "content/browser/browser_plugin/browser_plugin_guest.h"
10 #include "content/browser/frame_host/render_widget_host_view_guest.h" 10 #include "content/browser/frame_host/render_widget_host_view_guest.h"
11 #include "content/browser/renderer_host/render_view_host_impl.h" 11 #include "content/browser/renderer_host/render_view_host_impl.h"
12 #include "content/common/browser_plugin/browser_plugin_messages.h" 12 #include "content/common/browser_plugin/browser_plugin_messages.h"
13 #include "content/common/frame_messages.h" 13 #include "content/common/frame_messages.h"
14 #include "content/common/gpu/gpu_messages.h" 14 #include "content/common/gpu/gpu_messages.h"
15 #include "content/common/host_shared_bitmap_manager.h" 15 #include "content/common/host_shared_bitmap_manager.h"
16 #include "content/common/input/web_touch_event_traits.h" 16 #include "content/common/input/web_touch_event_traits.h"
17 #include "content/common/view_messages.h" 17 #include "content/common/view_messages.h"
18 #include "content/common/webplugin_geometry.h" 18 #include "content/common/webplugin_geometry.h"
19 #include "content/public/common/content_switches.h" 19 #include "content/public/common/content_switches.h"
20 #include "skia/ext/platform_canvas.h" 20 #include "skia/ext/platform_canvas.h"
21 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 21 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
22 #include "ui/events/gestures/unified_gesture_detector_enabled.h"
22 23
23 #if defined(OS_MACOSX) 24 #if defined(OS_MACOSX)
24 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h" 25 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h"
25 #endif 26 #endif
26 27
27 #if defined(USE_AURA) 28 #if defined(USE_AURA)
28 #include "content/browser/renderer_host/ui_events_helper.h" 29 #include "content/browser/renderer_host/ui_events_helper.h"
29 #endif 30 #endif
30 31
31 namespace content { 32 namespace content {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // that touch point is released. 104 // that touch point is released.
104 ScopedVector<ui::TouchEvent> events; 105 ScopedVector<ui::TouchEvent> events;
105 if (!MakeUITouchEventsFromWebTouchEvents(touch, &events, LOCAL_COORDINATES)) 106 if (!MakeUITouchEventsFromWebTouchEvents(touch, &events, LOCAL_COORDINATES))
106 return; 107 return;
107 108
108 ui::EventResult result = (ack_result == 109 ui::EventResult result = (ack_result ==
109 INPUT_EVENT_ACK_STATE_CONSUMED) ? ui::ER_HANDLED : ui::ER_UNHANDLED; 110 INPUT_EVENT_ACK_STATE_CONSUMED) ? ui::ER_HANDLED : ui::ER_UNHANDLED;
110 for (ScopedVector<ui::TouchEvent>::iterator iter = events.begin(), 111 for (ScopedVector<ui::TouchEvent>::iterator iter = events.begin(),
111 end = events.end(); iter != end; ++iter) { 112 end = events.end(); iter != end; ++iter) {
112 scoped_ptr<ui::GestureRecognizer::Gestures> gestures; 113 scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
113 gestures.reset(gesture_recognizer_->ProcessTouchEventForGesture( 114 if (ui::IsUnifiedGestureDetectorEnabled()) {
114 *(*iter), result, this)); 115 if (!ui::GestureRecognizer::Get()->ProcessTouchEventForGesture(*(*iter),
116 this)) {
117 gestures.reset(ui::GestureRecognizer::Get()->AckTouchEventForGesture(
118 result, this));
119 }
120 } else {
jdduke (slow) 2014/07/30 15:29:32 This branching is unfortunate but I guess it won't
tdresser 2014/07/31 15:33:31 Assuming we can land eager GR in 38, I'm hoping to
121 gestures.reset(
122 gesture_recognizer_->ProcessTouchEventForGestureForOldAuraGR(
123 *(*iter), result, this));
124 }
115 ProcessGestures(gestures.get()); 125 ProcessGestures(gestures.get());
116 } 126 }
117 } 127 }
118 #endif 128 #endif
119 129
120 gfx::Rect RenderWidgetHostViewGuest::GetViewBounds() const { 130 gfx::Rect RenderWidgetHostViewGuest::GetViewBounds() const {
121 if (!guest_) 131 if (!guest_)
122 return gfx::Rect(); 132 return gfx::Rect();
123 133
124 RenderWidgetHostViewBase* rwhv = GetGuestRenderWidgetHostView(); 134 RenderWidgetHostViewBase* rwhv = GetGuestRenderWidgetHostView();
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 return kN32_SkColorType; 558 return kN32_SkColorType;
549 } 559 }
550 560
551 RenderWidgetHostViewBase* 561 RenderWidgetHostViewBase*
552 RenderWidgetHostViewGuest::GetGuestRenderWidgetHostView() const { 562 RenderWidgetHostViewGuest::GetGuestRenderWidgetHostView() const {
553 return static_cast<RenderWidgetHostViewBase*>( 563 return static_cast<RenderWidgetHostViewBase*>(
554 guest_->GetEmbedderRenderWidgetHostView()); 564 guest_->GetEmbedderRenderWidgetHostView());
555 } 565 }
556 566
557 } // namespace content 567 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/input/input_router_impl.h » ('j') | ui/aura/window_event_dispatcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698