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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 26664002: SyntheticGestureTarget implementation for injecting synthetic input events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 7 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/browser/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 15 matching lines...) Expand all
26 #include "cc/trees/layer_tree_host.h" 26 #include "cc/trees/layer_tree_host.h"
27 #include "content/browser/accessibility/browser_accessibility_manager_android.h" 27 #include "content/browser/accessibility/browser_accessibility_manager_android.h"
28 #include "content/browser/android/content_view_core_impl.h" 28 #include "content/browser/android/content_view_core_impl.h"
29 #include "content/browser/android/in_process/synchronous_compositor_impl.h" 29 #include "content/browser/android/in_process/synchronous_compositor_impl.h"
30 #include "content/browser/android/overscroll_glow.h" 30 #include "content/browser/android/overscroll_glow.h"
31 #include "content/browser/gpu/gpu_surface_tracker.h" 31 #include "content/browser/gpu/gpu_surface_tracker.h"
32 #include "content/browser/renderer_host/compositor_impl_android.h" 32 #include "content/browser/renderer_host/compositor_impl_android.h"
33 #include "content/browser/renderer_host/dip_util.h" 33 #include "content/browser/renderer_host/dip_util.h"
34 #include "content/browser/renderer_host/generic_touch_gesture_android.h" 34 #include "content/browser/renderer_host/generic_touch_gesture_android.h"
35 #include "content/browser/renderer_host/image_transport_factory_android.h" 35 #include "content/browser/renderer_host/image_transport_factory_android.h"
36 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h "
36 #include "content/browser/renderer_host/render_widget_host_impl.h" 37 #include "content/browser/renderer_host/render_widget_host_impl.h"
37 #include "content/common/gpu/client/gl_helper.h" 38 #include "content/common/gpu/client/gl_helper.h"
38 #include "content/common/gpu/gpu_messages.h" 39 #include "content/common/gpu/gpu_messages.h"
39 #include "content/common/input_messages.h" 40 #include "content/common/input_messages.h"
40 #include "content/common/view_messages.h" 41 #include "content/common/view_messages.h"
41 #include "content/public/common/content_switches.h" 42 #include "content/public/common/content_switches.h"
42 #include "skia/ext/image_operations.h" 43 #include "skia/ext/image_operations.h"
43 #include "third_party/khronos/GLES2/gl2.h" 44 #include "third_party/khronos/GLES2/gl2.h"
44 #include "third_party/khronos/GLES2/gl2ext.h" 45 #include "third_party/khronos/GLES2/gl2ext.h"
45 #include "ui/gfx/android/device_display_info.h" 46 #include "ui/gfx/android/device_display_info.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 } 616 }
616 617
617 void RenderWidgetHostViewAndroid::ShowDisambiguationPopup( 618 void RenderWidgetHostViewAndroid::ShowDisambiguationPopup(
618 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) { 619 const gfx::Rect& target_rect, const SkBitmap& zoomed_bitmap) {
619 if (!content_view_core_) 620 if (!content_view_core_)
620 return; 621 return;
621 622
622 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap); 623 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap);
623 } 624 }
624 625
626 scoped_ptr<SyntheticGestureTarget>
627 RenderWidgetHostViewAndroid::CreateSyntheticGestureTarget() {
628 return scoped_ptr<SyntheticGestureTarget>(new SyntheticGestureTargetAndroid(
629 host_, content_view_core_->CreateTouchEventSynthesizer()));
630 }
631
625 SyntheticGesture* RenderWidgetHostViewAndroid::CreateSmoothScrollGesture( 632 SyntheticGesture* RenderWidgetHostViewAndroid::CreateSmoothScrollGesture(
626 bool scroll_down, int pixels_to_scroll, int mouse_event_x, 633 bool scroll_down, int pixels_to_scroll, int mouse_event_x,
627 int mouse_event_y) { 634 int mouse_event_y) {
628 return new GenericTouchGestureAndroid( 635 return new GenericTouchGestureAndroid(
629 GetRenderWidgetHost(), 636 GetRenderWidgetHost(),
630 content_view_core_->CreateOnePointTouchGesture( 637 content_view_core_->CreateOnePointTouchGesture(
631 mouse_event_x, mouse_event_y, 638 mouse_event_x, mouse_event_y,
632 0, scroll_down ? -pixels_to_scroll : pixels_to_scroll)); 639 0, scroll_down ? -pixels_to_scroll : pixels_to_scroll));
633 } 640 }
634 641
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 // RenderWidgetHostView, public: 1408 // RenderWidgetHostView, public:
1402 1409
1403 // static 1410 // static
1404 RenderWidgetHostView* 1411 RenderWidgetHostView*
1405 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 1412 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
1406 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 1413 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
1407 return new RenderWidgetHostViewAndroid(rwhi, NULL); 1414 return new RenderWidgetHostViewAndroid(rwhi, NULL);
1408 } 1415 }
1409 1416
1410 } // namespace content 1417 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698