Chromium Code Reviews| 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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 900 legacy_window_destroyed_ = true; | 900 legacy_window_destroyed_ = true; |
| 901 } | 901 } |
| 902 #endif | 902 #endif |
| 903 | 903 |
| 904 void RenderWidgetHostViewAura::OnSwapCompositorFrame( | 904 void RenderWidgetHostViewAura::OnSwapCompositorFrame( |
| 905 uint32_t compositor_frame_sink_id, | 905 uint32_t compositor_frame_sink_id, |
| 906 cc::CompositorFrame frame) { | 906 cc::CompositorFrame frame) { |
| 907 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); | 907 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); |
| 908 | 908 |
| 909 last_scroll_offset_ = frame.metadata.root_scroll_offset; | 909 last_scroll_offset_ = frame.metadata.root_scroll_offset; |
| 910 if (!frame.delegated_frame_data) | |
| 911 return; | |
| 912 | 910 |
| 913 cc::Selection<gfx::SelectionBound> selection = frame.metadata.selection; | 911 cc::Selection<gfx::SelectionBound> selection = frame.metadata.selection; |
| 914 if (IsUseZoomForDSFEnabled()) { | 912 if (IsUseZoomForDSFEnabled()) { |
| 915 float viewportToDIPScale = 1.0f / current_device_scale_factor_; | 913 float viewportToDIPScale = 1.0f / current_device_scale_factor_; |
| 916 gfx::PointF start_edge_top = selection.start.edge_top(); | 914 gfx::PointF start_edge_top = selection.start.edge_top(); |
| 917 gfx::PointF start_edge_bottom = selection.start.edge_bottom(); | 915 gfx::PointF start_edge_bottom = selection.start.edge_bottom(); |
| 918 gfx::PointF end_edge_top = selection.end.edge_top(); | 916 gfx::PointF end_edge_top = selection.end.edge_top(); |
| 919 gfx::PointF end_edge_bottom = selection.end.edge_bottom(); | 917 gfx::PointF end_edge_bottom = selection.end.edge_bottom(); |
| 920 | 918 |
| 921 start_edge_top.Scale(viewportToDIPScale); | 919 start_edge_top.Scale(viewportToDIPScale); |
| 922 start_edge_bottom.Scale(viewportToDIPScale); | 920 start_edge_bottom.Scale(viewportToDIPScale); |
| 923 end_edge_top.Scale(viewportToDIPScale); | 921 end_edge_top.Scale(viewportToDIPScale); |
| 924 end_edge_bottom.Scale(viewportToDIPScale); | 922 end_edge_bottom.Scale(viewportToDIPScale); |
| 925 | 923 |
| 926 selection.start.SetEdge(start_edge_top, start_edge_bottom); | 924 selection.start.SetEdge(start_edge_top, start_edge_bottom); |
| 927 selection.end.SetEdge(end_edge_top, end_edge_bottom); | 925 selection.end.SetEdge(end_edge_top, end_edge_bottom); |
| 928 } | 926 } |
| 929 | 927 |
| 930 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, | 928 if (!frame.render_pass_list.empty()) |
|
danakj
2016/10/28 22:02:54
{} for multi-line blocks
but before the selection
| |
| 931 std::move(frame)); | 929 delegated_frame_host_->SwapDelegatedFrame(compositor_frame_sink_id, |
| 930 std::move(frame)); | |
| 932 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control, | 931 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control, |
| 933 selection.start, selection.end); | 932 selection.start, selection.end); |
| 934 } | 933 } |
| 935 | 934 |
| 936 void RenderWidgetHostViewAura::ClearCompositorFrame() { | 935 void RenderWidgetHostViewAura::ClearCompositorFrame() { |
| 937 delegated_frame_host_->ClearDelegatedFrame(); | 936 delegated_frame_host_->ClearDelegatedFrame(); |
| 938 } | 937 } |
| 939 | 938 |
| 940 void RenderWidgetHostViewAura::DidStopFlinging() { | 939 void RenderWidgetHostViewAura::DidStopFlinging() { |
| 941 selection_controller_client_->OnScrollCompleted(); | 940 selection_controller_client_->OnScrollCompleted(); |
| (...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2380 | 2379 |
| 2381 void RenderWidgetHostViewAura::SetPopupChild( | 2380 void RenderWidgetHostViewAura::SetPopupChild( |
| 2382 RenderWidgetHostViewAura* popup_child_host_view) { | 2381 RenderWidgetHostViewAura* popup_child_host_view) { |
| 2383 popup_child_host_view_ = popup_child_host_view; | 2382 popup_child_host_view_ = popup_child_host_view; |
| 2384 event_handler_->SetPopupChild( | 2383 event_handler_->SetPopupChild( |
| 2385 popup_child_host_view, | 2384 popup_child_host_view, |
| 2386 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); | 2385 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); |
| 2387 } | 2386 } |
| 2388 | 2387 |
| 2389 } // namespace content | 2388 } // namespace content |
| OLD | NEW |