| 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_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 27 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 28 #include "content/browser/bad_message.h" | 28 #include "content/browser/bad_message.h" |
| 29 #include "content/browser/frame_host/frame_tree.h" | 29 #include "content/browser/frame_host/frame_tree.h" |
| 30 #include "content/browser/frame_host/frame_tree_node.h" | 30 #include "content/browser/frame_host/frame_tree_node.h" |
| 31 #include "content/browser/frame_host/render_frame_host_impl.h" | 31 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 32 #include "content/browser/gpu/compositor_util.h" | 32 #include "content/browser/gpu/compositor_util.h" |
| 33 #include "content/browser/renderer_host/compositor_resize_lock_aura.h" | 33 #include "content/browser/renderer_host/compositor_resize_lock_aura.h" |
| 34 #include "content/browser/renderer_host/dip_util.h" | 34 #include "content/browser/renderer_host/dip_util.h" |
| 35 #include "content/browser/renderer_host/input/synthetic_gesture_target_aura.h" | 35 #include "content/browser/renderer_host/input/synthetic_gesture_target_aura.h" |
| 36 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" | 36 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" |
| 37 #include "content/browser/renderer_host/input/ui_touch_selection_helper.h" | |
| 38 #include "content/browser/renderer_host/input/web_input_event_util.h" | 37 #include "content/browser/renderer_host/input/web_input_event_util.h" |
| 39 #include "content/browser/renderer_host/overscroll_controller.h" | 38 #include "content/browser/renderer_host/overscroll_controller.h" |
| 40 #include "content/browser/renderer_host/render_view_host_delegate.h" | 39 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 41 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 40 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 42 #include "content/browser/renderer_host/render_view_host_impl.h" | 41 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 43 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 42 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| 44 #include "content/browser/renderer_host/render_widget_host_impl.h" | 43 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 45 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" | 44 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
| 46 #include "content/browser/renderer_host/ui_events_helper.h" | 45 #include "content/browser/renderer_host/ui_events_helper.h" |
| 47 #include "content/browser/renderer_host/web_input_event_aura.h" | 46 #include "content/browser/renderer_host/web_input_event_aura.h" |
| (...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 | 1155 |
| 1157 void RenderWidgetHostViewAura::OnSwapCompositorFrame( | 1156 void RenderWidgetHostViewAura::OnSwapCompositorFrame( |
| 1158 uint32_t output_surface_id, | 1157 uint32_t output_surface_id, |
| 1159 std::unique_ptr<cc::CompositorFrame> frame) { | 1158 std::unique_ptr<cc::CompositorFrame> frame) { |
| 1160 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); | 1159 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); |
| 1161 | 1160 |
| 1162 last_scroll_offset_ = frame->metadata.root_scroll_offset; | 1161 last_scroll_offset_ = frame->metadata.root_scroll_offset; |
| 1163 if (!frame->delegated_frame_data) | 1162 if (!frame->delegated_frame_data) |
| 1164 return; | 1163 return; |
| 1165 | 1164 |
| 1166 cc::ViewportSelection selection = frame->metadata.selection; | 1165 cc::Selection<gfx::SelectionBound> selection = frame->metadata.selection; |
| 1167 if (IsUseZoomForDSFEnabled()) { | 1166 if (IsUseZoomForDSFEnabled()) { |
| 1168 float viewportToDIPScale = 1.0f / current_device_scale_factor_; | 1167 float viewportToDIPScale = 1.0f / current_device_scale_factor_; |
| 1169 selection.start.edge_top.Scale(viewportToDIPScale); | 1168 gfx::PointF start_edge_top = selection.start.edge_top(); |
| 1170 selection.start.edge_bottom.Scale(viewportToDIPScale); | 1169 gfx::PointF start_edge_bottom = selection.start.edge_bottom(); |
| 1171 selection.end.edge_top.Scale(viewportToDIPScale); | 1170 gfx::PointF end_edge_top = selection.end.edge_top(); |
| 1172 selection.end.edge_bottom.Scale(viewportToDIPScale); | 1171 gfx::PointF end_edge_bottom = selection.end.edge_bottom(); |
| 1172 |
| 1173 start_edge_top.Scale(viewportToDIPScale); |
| 1174 start_edge_bottom.Scale(viewportToDIPScale); |
| 1175 end_edge_top.Scale(viewportToDIPScale); |
| 1176 end_edge_bottom.Scale(viewportToDIPScale); |
| 1177 |
| 1178 selection.start.SetEdge(start_edge_top, start_edge_bottom); |
| 1179 selection.end.SetEdge(end_edge_top, end_edge_bottom); |
| 1173 } | 1180 } |
| 1174 | 1181 |
| 1175 delegated_frame_host_->SwapDelegatedFrame(output_surface_id, | 1182 delegated_frame_host_->SwapDelegatedFrame(output_surface_id, |
| 1176 std::move(frame)); | 1183 std::move(frame)); |
| 1177 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control, | 1184 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control, |
| 1178 ConvertSelectionBound(selection.start), | 1185 selection.start, selection.end); |
| 1179 ConvertSelectionBound(selection.end)); | |
| 1180 } | 1186 } |
| 1181 | 1187 |
| 1182 void RenderWidgetHostViewAura::ClearCompositorFrame() { | 1188 void RenderWidgetHostViewAura::ClearCompositorFrame() { |
| 1183 delegated_frame_host_->ClearDelegatedFrame(); | 1189 delegated_frame_host_->ClearDelegatedFrame(); |
| 1184 } | 1190 } |
| 1185 | 1191 |
| 1186 void RenderWidgetHostViewAura::DidStopFlinging() { | 1192 void RenderWidgetHostViewAura::DidStopFlinging() { |
| 1187 selection_controller_client_->OnScrollCompleted(); | 1193 selection_controller_client_->OnScrollCompleted(); |
| 1188 } | 1194 } |
| 1189 | 1195 |
| (...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2991 | 2997 |
| 2992 //////////////////////////////////////////////////////////////////////////////// | 2998 //////////////////////////////////////////////////////////////////////////////// |
| 2993 // RenderWidgetHostViewBase, public: | 2999 // RenderWidgetHostViewBase, public: |
| 2994 | 3000 |
| 2995 // static | 3001 // static |
| 2996 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 3002 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 2997 GetScreenInfoForWindow(results, NULL); | 3003 GetScreenInfoForWindow(results, NULL); |
| 2998 } | 3004 } |
| 2999 | 3005 |
| 3000 } // namespace content | 3006 } // namespace content |
| OLD | NEW |