| 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 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "content/browser/android/synchronous_compositor_host.h" | 42 #include "content/browser/android/synchronous_compositor_host.h" |
| 43 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 43 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 44 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 44 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 45 #include "content/browser/gpu/compositor_util.h" | 45 #include "content/browser/gpu/compositor_util.h" |
| 46 #include "content/browser/gpu/gpu_data_manager_impl.h" | 46 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 47 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 47 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 48 #include "content/browser/media/android/media_web_contents_observer_android.h" | 48 #include "content/browser/media/android/media_web_contents_observer_android.h" |
| 49 #include "content/browser/renderer_host/compositor_impl_android.h" | 49 #include "content/browser/renderer_host/compositor_impl_android.h" |
| 50 #include "content/browser/renderer_host/dip_util.h" | 50 #include "content/browser/renderer_host/dip_util.h" |
| 51 #include "content/browser/renderer_host/frame_metadata_util.h" | 51 #include "content/browser/renderer_host/frame_metadata_util.h" |
| 52 #include "content/browser/renderer_host/input/input_router_impl.h" |
| 52 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h
" | 53 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h
" |
| 53 #include "content/browser/renderer_host/input/web_input_event_builders_android.h
" | 54 #include "content/browser/renderer_host/input/web_input_event_builders_android.h
" |
| 54 #include "content/browser/renderer_host/render_process_host_impl.h" | 55 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 55 #include "content/browser/renderer_host/render_view_host_impl.h" | 56 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 56 #include "content/browser/renderer_host/render_widget_host_impl.h" | 57 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 57 #include "content/common/gpu_host_messages.h" | 58 #include "content/common/gpu_host_messages.h" |
| 58 #include "content/common/input_messages.h" | 59 #include "content/common/input_messages.h" |
| 59 #include "content/common/view_messages.h" | 60 #include "content/common/view_messages.h" |
| 60 #include "content/public/browser/android/compositor.h" | 61 #include "content/public/browser/android/compositor.h" |
| 61 #include "content/public/browser/android/synchronous_compositor_client.h" | 62 #include "content/public/browser/android/synchronous_compositor_client.h" |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 | 1021 |
| 1021 last_frame_info_.reset( | 1022 last_frame_info_.reset( |
| 1022 new LastFrameInfo(output_surface_id, std::move(frame))); | 1023 new LastFrameInfo(output_surface_id, std::move(frame))); |
| 1023 } | 1024 } |
| 1024 | 1025 |
| 1025 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( | 1026 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( |
| 1026 cc::CompositorFrameMetadata frame_metadata) { | 1027 cc::CompositorFrameMetadata frame_metadata) { |
| 1027 if (!content_view_core_) | 1028 if (!content_view_core_) |
| 1028 return; | 1029 return; |
| 1029 | 1030 |
| 1031 bool is_mobile_optimized = IsMobileOptimizedFrame(frame_metadata); |
| 1032 |
| 1033 if (host_ && host_->input_router()) { |
| 1034 host_->input_router()->NotifySiteIsMobileOptimized( |
| 1035 is_mobile_optimized); |
| 1036 } |
| 1037 |
| 1030 // This is a subset of OnSwapCompositorFrame() used in the synchronous | 1038 // This is a subset of OnSwapCompositorFrame() used in the synchronous |
| 1031 // compositor flow. | 1039 // compositor flow. |
| 1032 OnFrameMetadataUpdated(frame_metadata.Clone(), false); | 1040 OnFrameMetadataUpdated(frame_metadata.Clone(), false); |
| 1033 | 1041 |
| 1034 // DevTools ScreenCast support for Android WebView. | 1042 // DevTools ScreenCast support for Android WebView. |
| 1035 WebContents* web_contents = content_view_core_->GetWebContents(); | 1043 WebContents* web_contents = content_view_core_->GetWebContents(); |
| 1036 if (DevToolsAgentHost::HasFor(web_contents)) { | 1044 if (DevToolsAgentHost::HasFor(web_contents)) { |
| 1037 scoped_refptr<DevToolsAgentHost> dtah = | 1045 scoped_refptr<DevToolsAgentHost> dtah = |
| 1038 DevToolsAgentHost::GetOrCreateFor(web_contents); | 1046 DevToolsAgentHost::GetOrCreateFor(web_contents); |
| 1039 // Unblock the compositor. | 1047 // Unblock the compositor. |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1872 case ui::MotionEvent::ACTION_UP: | 1880 case ui::MotionEvent::ACTION_UP: |
| 1873 case ui::MotionEvent::ACTION_POINTER_UP: | 1881 case ui::MotionEvent::ACTION_POINTER_UP: |
| 1874 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 1882 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
| 1875 delta.InMicroseconds(), 1, 1000000, 50); | 1883 delta.InMicroseconds(), 1, 1000000, 50); |
| 1876 default: | 1884 default: |
| 1877 return; | 1885 return; |
| 1878 } | 1886 } |
| 1879 } | 1887 } |
| 1880 | 1888 |
| 1881 } // namespace content | 1889 } // namespace content |
| OLD | NEW |