OLD | NEW |
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 |
11 #include "base/android/build_info.h" | 11 #include "base/android/build_info.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/callback_helpers.h" | 13 #include "base/callback_helpers.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
19 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
21 #include "base/sys_info.h" | 21 #include "base/sys_info.h" |
22 #include "base/threading/worker_pool.h" | 22 #include "base/threading/worker_pool.h" |
23 #include "cc/layers/layer.h" | 23 #include "cc/layers/layer.h" |
24 #include "cc/layers/surface_layer.h" | 24 #include "cc/layers/surface_layer.h" |
25 #include "cc/output/compositor_frame.h" | 25 #include "cc/output/compositor_frame.h" |
26 #include "cc/output/compositor_frame_ack.h" | 26 #include "cc/output/compositor_frame_ack.h" |
27 #include "cc/output/copy_output_request.h" | 27 #include "cc/output/copy_output_request.h" |
28 #include "cc/output/copy_output_result.h" | 28 #include "cc/output/copy_output_result.h" |
29 #include "cc/output/latency_info_swap_promise.h" | 29 #include "cc/output/latency_info_swap_promise.h" |
30 #include "cc/output/viewport_selection_bound.h" | |
31 #include "cc/resources/single_release_callback.h" | 30 #include "cc/resources/single_release_callback.h" |
32 #include "cc/surfaces/surface.h" | 31 #include "cc/surfaces/surface.h" |
33 #include "cc/surfaces/surface_factory.h" | 32 #include "cc/surfaces/surface_factory.h" |
34 #include "cc/surfaces/surface_id_allocator.h" | 33 #include "cc/surfaces/surface_id_allocator.h" |
35 #include "cc/surfaces/surface_manager.h" | 34 #include "cc/surfaces/surface_manager.h" |
36 #include "cc/trees/layer_tree_host.h" | 35 #include "cc/trees/layer_tree_host.h" |
37 #include "components/display_compositor/gl_helper.h" | 36 #include "components/display_compositor/gl_helper.h" |
38 #include "content/browser/accessibility/browser_accessibility_manager_android.h" | 37 #include "content/browser/accessibility/browser_accessibility_manager_android.h" |
39 #include "content/browser/android/composited_touch_handle_drawable.h" | 38 #include "content/browser/android/composited_touch_handle_drawable.h" |
40 #include "content/browser/android/content_view_core_impl.h" | 39 #include "content/browser/android/content_view_core_impl.h" |
41 #include "content/browser/android/overscroll_controller_android.h" | 40 #include "content/browser/android/overscroll_controller_android.h" |
42 #include "content/browser/android/popup_touch_handle_drawable.h" | 41 #include "content/browser/android/popup_touch_handle_drawable.h" |
43 #include "content/browser/android/synchronous_compositor_host.h" | 42 #include "content/browser/android/synchronous_compositor_host.h" |
44 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 43 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
45 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 44 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
46 #include "content/browser/gpu/compositor_util.h" | 45 #include "content/browser/gpu/compositor_util.h" |
47 #include "content/browser/gpu/gpu_data_manager_impl.h" | 46 #include "content/browser/gpu/gpu_data_manager_impl.h" |
48 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 47 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
49 #include "content/browser/media/android/media_web_contents_observer_android.h" | 48 #include "content/browser/media/android/media_web_contents_observer_android.h" |
50 #include "content/browser/renderer_host/compositor_impl_android.h" | 49 #include "content/browser/renderer_host/compositor_impl_android.h" |
51 #include "content/browser/renderer_host/dip_util.h" | 50 #include "content/browser/renderer_host/dip_util.h" |
52 #include "content/browser/renderer_host/frame_metadata_util.h" | 51 #include "content/browser/renderer_host/frame_metadata_util.h" |
53 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h
" | 52 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h
" |
54 #include "content/browser/renderer_host/input/ui_touch_selection_helper.h" | |
55 #include "content/browser/renderer_host/input/web_input_event_builders_android.h
" | 53 #include "content/browser/renderer_host/input/web_input_event_builders_android.h
" |
56 #include "content/browser/renderer_host/input/web_input_event_util.h" | 54 #include "content/browser/renderer_host/input/web_input_event_util.h" |
57 #include "content/browser/renderer_host/render_process_host_impl.h" | 55 #include "content/browser/renderer_host/render_process_host_impl.h" |
58 #include "content/browser/renderer_host/render_view_host_impl.h" | 56 #include "content/browser/renderer_host/render_view_host_impl.h" |
59 #include "content/browser/renderer_host/render_widget_host_impl.h" | 57 #include "content/browser/renderer_host/render_widget_host_impl.h" |
60 #include "content/common/gpu_host_messages.h" | 58 #include "content/common/gpu_host_messages.h" |
61 #include "content/common/gpu_process_launch_causes.h" | 59 #include "content/common/gpu_process_launch_causes.h" |
62 #include "content/common/input/did_overscroll_params.h" | 60 #include "content/common/input/did_overscroll_params.h" |
63 #include "content/common/input_messages.h" | 61 #include "content/common/input_messages.h" |
64 #include "content/common/view_messages.h" | 62 #include "content/common/view_messages.h" |
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 | 1277 |
1280 if (overscroll_controller_) | 1278 if (overscroll_controller_) |
1281 overscroll_controller_->OnFrameMetadataUpdated(frame_metadata); | 1279 overscroll_controller_->OnFrameMetadataUpdated(frame_metadata); |
1282 | 1280 |
1283 if (selection_controller_) { | 1281 if (selection_controller_) { |
1284 selection_controller_->OnSelectionEditable( | 1282 selection_controller_->OnSelectionEditable( |
1285 frame_metadata.selection.is_editable); | 1283 frame_metadata.selection.is_editable); |
1286 selection_controller_->OnSelectionEmpty( | 1284 selection_controller_->OnSelectionEmpty( |
1287 frame_metadata.selection.is_empty_text_form_control); | 1285 frame_metadata.selection.is_empty_text_form_control); |
1288 selection_controller_->OnSelectionBoundsChanged( | 1286 selection_controller_->OnSelectionBoundsChanged( |
1289 ConvertSelectionBound(frame_metadata.selection.start), | 1287 frame_metadata.selection.start, frame_metadata.selection.end); |
1290 ConvertSelectionBound(frame_metadata.selection.end)); | |
1291 | 1288 |
1292 // Set parameters for adaptive handle orientation. | 1289 // Set parameters for adaptive handle orientation. |
1293 gfx::SizeF viewport_size(frame_metadata.scrollable_viewport_size); | 1290 gfx::SizeF viewport_size(frame_metadata.scrollable_viewport_size); |
1294 viewport_size.Scale(frame_metadata.page_scale_factor); | 1291 viewport_size.Scale(frame_metadata.page_scale_factor); |
1295 gfx::RectF viewport_rect( | 1292 gfx::RectF viewport_rect( |
1296 frame_metadata.location_bar_content_translation.x(), | 1293 frame_metadata.location_bar_content_translation.x(), |
1297 frame_metadata.location_bar_content_translation.y(), | 1294 frame_metadata.location_bar_content_translation.y(), |
1298 viewport_size.width(), viewport_size.height()); | 1295 viewport_size.width(), viewport_size.height()); |
1299 selection_controller_->OnViewportChanged(viewport_rect); | 1296 selection_controller_->OnViewportChanged(viewport_rect); |
1300 } | 1297 } |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2045 case ui::MotionEvent::ACTION_UP: | 2042 case ui::MotionEvent::ACTION_UP: |
2046 case ui::MotionEvent::ACTION_POINTER_UP: | 2043 case ui::MotionEvent::ACTION_POINTER_UP: |
2047 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 2044 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
2048 delta.InMicroseconds(), 1, 1000000, 50); | 2045 delta.InMicroseconds(), 1, 1000000, 50); |
2049 default: | 2046 default: |
2050 return; | 2047 return; |
2051 } | 2048 } |
2052 } | 2049 } |
2053 | 2050 |
2054 } // namespace content | 2051 } // namespace content |
OLD | NEW |