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

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

Issue 1740193002: Fix the coordinates for touch selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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_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 26 matching lines...) Expand all
37 #include "content/browser/renderer_host/input/web_input_event_util.h" 37 #include "content/browser/renderer_host/input/web_input_event_util.h"
38 #include "content/browser/renderer_host/overscroll_controller.h" 38 #include "content/browser/renderer_host/overscroll_controller.h"
39 #include "content/browser/renderer_host/render_view_host_delegate.h" 39 #include "content/browser/renderer_host/render_view_host_delegate.h"
40 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 40 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
41 #include "content/browser/renderer_host/render_view_host_impl.h" 41 #include "content/browser/renderer_host/render_view_host_impl.h"
42 #include "content/browser/renderer_host/render_widget_host_delegate.h" 42 #include "content/browser/renderer_host/render_widget_host_delegate.h"
43 #include "content/browser/renderer_host/render_widget_host_impl.h" 43 #include "content/browser/renderer_host/render_widget_host_impl.h"
44 #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"
45 #include "content/browser/renderer_host/ui_events_helper.h" 45 #include "content/browser/renderer_host/ui_events_helper.h"
46 #include "content/browser/renderer_host/web_input_event_aura.h" 46 #include "content/browser/renderer_host/web_input_event_aura.h"
47 #include "content/common/content_switches_internal.h"
47 #include "content/common/gpu/client/gl_helper.h" 48 #include "content/common/gpu/client/gl_helper.h"
48 #include "content/common/gpu/gpu_messages.h" 49 #include "content/common/gpu/gpu_messages.h"
49 #include "content/common/site_isolation_policy.h" 50 #include "content/common/site_isolation_policy.h"
50 #include "content/common/view_messages.h" 51 #include "content/common/view_messages.h"
51 #include "content/public/browser/content_browser_client.h" 52 #include "content/public/browser/content_browser_client.h"
52 #include "content/public/browser/overscroll_configuration.h" 53 #include "content/public/browser/overscroll_configuration.h"
53 #include "content/public/browser/render_view_host.h" 54 #include "content/public/browser/render_view_host.h"
54 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" 55 #include "content/public/browser/render_widget_host_view_frame_subscriber.h"
55 #include "content/public/browser/user_metrics.h" 56 #include "content/public/browser/user_metrics.h"
56 #include "content/public/common/content_switches.h" 57 #include "content/public/common/content_switches.h"
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 void RenderWidgetHostViewAura::OnSwapCompositorFrame( 1203 void RenderWidgetHostViewAura::OnSwapCompositorFrame(
1203 uint32_t output_surface_id, 1204 uint32_t output_surface_id,
1204 scoped_ptr<cc::CompositorFrame> frame) { 1205 scoped_ptr<cc::CompositorFrame> frame) {
1205 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); 1206 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame");
1206 1207
1207 last_scroll_offset_ = frame->metadata.root_scroll_offset; 1208 last_scroll_offset_ = frame->metadata.root_scroll_offset;
1208 if (!frame->delegated_frame_data) 1209 if (!frame->delegated_frame_data)
1209 return; 1210 return;
1210 1211
1211 cc::ViewportSelection selection = frame->metadata.selection; 1212 cc::ViewportSelection selection = frame->metadata.selection;
1213 if (IsUseZoomForDSFEnabled()) {
1214 float viewportToDIPScale = 1.0f / current_device_scale_factor_;
1215 selection.start.edge_top.Scale(viewportToDIPScale);
1216 selection.start.edge_bottom.Scale(viewportToDIPScale);
1217 selection.end.edge_top.Scale(viewportToDIPScale);
1218 selection.end.edge_bottom.Scale(viewportToDIPScale);
1219 }
1212 1220
1213 delegated_frame_host_->SwapDelegatedFrame(output_surface_id, 1221 delegated_frame_host_->SwapDelegatedFrame(output_surface_id,
1214 std::move(frame)); 1222 std::move(frame));
1215 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control, 1223 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control,
1216 ConvertSelectionBound(selection.start), 1224 ConvertSelectionBound(selection.start),
1217 ConvertSelectionBound(selection.end)); 1225 ConvertSelectionBound(selection.end));
1218 } 1226 }
1219 1227
1220 void RenderWidgetHostViewAura::ClearCompositorFrame() { 1228 void RenderWidgetHostViewAura::ClearCompositorFrame() {
1221 delegated_frame_host_->ClearDelegatedFrame(); 1229 delegated_frame_host_->ClearDelegatedFrame();
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after
3085 3093
3086 //////////////////////////////////////////////////////////////////////////////// 3094 ////////////////////////////////////////////////////////////////////////////////
3087 // RenderWidgetHostViewBase, public: 3095 // RenderWidgetHostViewBase, public:
3088 3096
3089 // static 3097 // static
3090 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 3098 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
3091 GetScreenInfoForWindow(results, NULL); 3099 GetScreenInfoForWindow(results, NULL);
3092 } 3100 }
3093 3101
3094 } // namespace content 3102 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698