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

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

Issue 2263043002: android_webview: Let AwContents manage TouchHandleDrawable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use SynchronousCompositorClient Created 4 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 (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 <utility> 9 #include <utility>
10 10
(...skipping 20 matching lines...) Expand all
31 #include "cc/surfaces/surface.h" 31 #include "cc/surfaces/surface.h"
32 #include "cc/surfaces/surface_factory.h" 32 #include "cc/surfaces/surface_factory.h"
33 #include "cc/surfaces/surface_id_allocator.h" 33 #include "cc/surfaces/surface_id_allocator.h"
34 #include "cc/surfaces/surface_manager.h" 34 #include "cc/surfaces/surface_manager.h"
35 #include "cc/trees/layer_tree_host.h" 35 #include "cc/trees/layer_tree_host.h"
36 #include "components/display_compositor/gl_helper.h" 36 #include "components/display_compositor/gl_helper.h"
37 #include "content/browser/accessibility/browser_accessibility_manager_android.h" 37 #include "content/browser/accessibility/browser_accessibility_manager_android.h"
38 #include "content/browser/android/composited_touch_handle_drawable.h" 38 #include "content/browser/android/composited_touch_handle_drawable.h"
39 #include "content/browser/android/content_view_core_impl.h" 39 #include "content/browser/android/content_view_core_impl.h"
40 #include "content/browser/android/overscroll_controller_android.h" 40 #include "content/browser/android/overscroll_controller_android.h"
41 #include "content/browser/android/popup_touch_handle_drawable.h"
42 #include "content/browser/android/synchronous_compositor_host.h" 41 #include "content/browser/android/synchronous_compositor_host.h"
43 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 42 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
44 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 43 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
45 #include "content/browser/gpu/compositor_util.h" 44 #include "content/browser/gpu/compositor_util.h"
46 #include "content/browser/gpu/gpu_data_manager_impl.h" 45 #include "content/browser/gpu/gpu_data_manager_impl.h"
47 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 46 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
48 #include "content/browser/media/android/media_web_contents_observer_android.h" 47 #include "content/browser/media/android/media_web_contents_observer_android.h"
49 #include "content/browser/renderer_host/compositor_impl_android.h" 48 #include "content/browser/renderer_host/compositor_impl_android.h"
50 #include "content/browser/renderer_host/dip_util.h" 49 #include "content/browser/renderer_host/dip_util.h"
51 #include "content/browser/renderer_host/frame_metadata_util.h" 50 #include "content/browser/renderer_host/frame_metadata_util.h"
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 ResetGestureDetection(); 1074 ResetGestureDetection();
1076 } 1075 }
1077 content_view_core_->OnSelectionEvent( 1076 content_view_core_->OnSelectionEvent(
1078 event, selection_controller_->GetStartPosition(), 1077 event, selection_controller_->GetStartPosition(),
1079 GetSelectionRect(*selection_controller_)); 1078 GetSelectionRect(*selection_controller_));
1080 } 1079 }
1081 1080
1082 std::unique_ptr<ui::TouchHandleDrawable> 1081 std::unique_ptr<ui::TouchHandleDrawable>
1083 RenderWidgetHostViewAndroid::CreateDrawable() { 1082 RenderWidgetHostViewAndroid::CreateDrawable() {
1084 DCHECK(content_view_core_); 1083 DCHECK(content_view_core_);
1085 if (!using_browser_compositor_) 1084 if (!using_browser_compositor_) {
1086 return PopupTouchHandleDrawable::Create( 1085 WebContentsImpl* web_contents_impl =
1087 content_view_core_, ui::GetScaleFactorForNativeView(GetNativeView())); 1086 static_cast<WebContentsImpl*>(content_view_core_->GetWebContents());
1088 1087 return std::unique_ptr<ui::TouchHandleDrawable>(
boliu 2016/08/24 23:35:30 don't go through web_contents here. you already ha
Jinsuk Kim 2016/08/25 07:32:21 Done.
1088 web_contents_impl->CreateDrawable());
1089 }
1089 return std::unique_ptr< 1090 return std::unique_ptr<
1090 ui::TouchHandleDrawable>(new CompositedTouchHandleDrawable( 1091 ui::TouchHandleDrawable>(new CompositedTouchHandleDrawable(
1091 content_view_core_->GetViewAndroid()->GetLayer(), 1092 content_view_core_->GetViewAndroid()->GetLayer(),
1092 ui::GetScaleFactorForNativeView(GetNativeView()), 1093 ui::GetScaleFactorForNativeView(GetNativeView()),
1093 // Use the activity context (instead of the application context) to ensure 1094 // Use the activity context (instead of the application context) to ensure
1094 // proper handle theming. 1095 // proper handle theming.
1095 content_view_core_->GetContext().obj())); 1096 content_view_core_->GetContext().obj()));
1096 } 1097 }
1097 1098
1098 void RenderWidgetHostViewAndroid::SynchronousCopyContents( 1099 void RenderWidgetHostViewAndroid::SynchronousCopyContents(
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1857 case ui::MotionEvent::ACTION_UP: 1858 case ui::MotionEvent::ACTION_UP:
1858 case ui::MotionEvent::ACTION_POINTER_UP: 1859 case ui::MotionEvent::ACTION_POINTER_UP:
1859 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 1860 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
1860 delta.InMicroseconds(), 1, 1000000, 50); 1861 delta.InMicroseconds(), 1, 1000000, 50);
1861 default: 1862 default:
1862 return; 1863 return;
1863 } 1864 }
1864 } 1865 }
1865 1866
1866 } // namespace content 1867 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698