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

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

Issue 62443007: Replace old with new synthetic gesture framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forward declare SyntheticGestureController. 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_data_manager_impl.h" 31 #include "content/browser/gpu/gpu_data_manager_impl.h"
32 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 32 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
33 #include "content/browser/gpu/gpu_surface_tracker.h" 33 #include "content/browser/gpu/gpu_surface_tracker.h"
34 #include "content/browser/renderer_host/compositor_impl_android.h" 34 #include "content/browser/renderer_host/compositor_impl_android.h"
35 #include "content/browser/renderer_host/dip_util.h" 35 #include "content/browser/renderer_host/dip_util.h"
36 #include "content/browser/renderer_host/generic_touch_gesture_android.h"
37 #include "content/browser/renderer_host/image_transport_factory_android.h" 36 #include "content/browser/renderer_host/image_transport_factory_android.h"
38 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h " 37 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h "
39 #include "content/browser/renderer_host/render_widget_host_impl.h" 38 #include "content/browser/renderer_host/render_widget_host_impl.h"
40 #include "content/common/gpu/client/gl_helper.h" 39 #include "content/common/gpu/client/gl_helper.h"
41 #include "content/common/gpu/gpu_messages.h" 40 #include "content/common/gpu/gpu_messages.h"
42 #include "content/common/input_messages.h" 41 #include "content/common/input_messages.h"
43 #include "content/common/view_messages.h" 42 #include "content/common/view_messages.h"
44 #include "content/public/common/content_switches.h" 43 #include "content/public/common/content_switches.h"
45 #include "gpu/config/gpu_driver_bug_workaround_type.h" 44 #include "gpu/config/gpu_driver_bug_workaround_type.h"
46 #include "skia/ext/image_operations.h" 45 #include "skia/ext/image_operations.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 615
617 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap); 616 content_view_core_->ShowDisambiguationPopup(target_rect, zoomed_bitmap);
618 } 617 }
619 618
620 scoped_ptr<SyntheticGestureTarget> 619 scoped_ptr<SyntheticGestureTarget>
621 RenderWidgetHostViewAndroid::CreateSyntheticGestureTarget() { 620 RenderWidgetHostViewAndroid::CreateSyntheticGestureTarget() {
622 return scoped_ptr<SyntheticGestureTarget>(new SyntheticGestureTargetAndroid( 621 return scoped_ptr<SyntheticGestureTarget>(new SyntheticGestureTargetAndroid(
623 host_, content_view_core_->CreateTouchEventSynthesizer())); 622 host_, content_view_core_->CreateTouchEventSynthesizer()));
624 } 623 }
625 624
626 SyntheticGesture* RenderWidgetHostViewAndroid::CreateSmoothScrollGesture(
627 bool scroll_down, int pixels_to_scroll, int mouse_event_x,
628 int mouse_event_y) {
629 return new GenericTouchGestureAndroid(
630 GetRenderWidgetHost(),
631 content_view_core_->CreateOnePointTouchGesture(
632 mouse_event_x, mouse_event_y,
633 0, scroll_down ? -pixels_to_scroll : pixels_to_scroll));
634 }
635
636 SyntheticGesture* RenderWidgetHostViewAndroid::CreatePinchGesture(
637 bool zoom_in, int pixels_to_move, int anchor_x,
638 int anchor_y) {
639 int distance_between_pointers = zoom_in ?
640 kMinimumPointerDistance : (kMinimumPointerDistance + pixels_to_move);
641 return new GenericTouchGestureAndroid(
642 GetRenderWidgetHost(),
643 content_view_core_->CreateTwoPointTouchGesture(
644 anchor_x, anchor_y - distance_between_pointers / 2,
645 0, (zoom_in ? -pixels_to_move : pixels_to_move) / 2,
646 anchor_x, anchor_y + distance_between_pointers / 2,
647 0, (zoom_in ? pixels_to_move : -pixels_to_move) / 2));
648 }
649
650 void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() { 625 void RenderWidgetHostViewAndroid::OnAcceleratedCompositingStateChange() {
651 } 626 }
652 627
653 void RenderWidgetHostViewAndroid::SendDelegatedFrameAck( 628 void RenderWidgetHostViewAndroid::SendDelegatedFrameAck(
654 uint32 output_surface_id) { 629 uint32 output_surface_id) {
655 cc::CompositorFrameAck ack; 630 cc::CompositorFrameAck ack;
656 if (resource_collection_.get()) 631 if (resource_collection_.get())
657 resource_collection_->TakeUnusedResourcesForChildCompositor(&ack.resources); 632 resource_collection_->TakeUnusedResourcesForChildCompositor(&ack.resources);
658 RenderWidgetHostImpl::SendSwapCompositorFrameAck(host_->GetRoutingID(), 633 RenderWidgetHostImpl::SendSwapCompositorFrameAck(host_->GetRoutingID(),
659 output_surface_id, 634 output_surface_id,
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 // RenderWidgetHostView, public: 1366 // RenderWidgetHostView, public:
1392 1367
1393 // static 1368 // static
1394 RenderWidgetHostView* 1369 RenderWidgetHostView*
1395 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 1370 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
1396 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 1371 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
1397 return new RenderWidgetHostViewAndroid(rwhi, NULL); 1372 return new RenderWidgetHostViewAndroid(rwhi, NULL);
1398 } 1373 }
1399 1374
1400 } // namespace content 1375 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698