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

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

Issue 2184033003: Refactor browser process coordinate transformation methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nasko comments addressed Created 4 years, 4 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 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 const ui::LatencyInfo& latency) { 2033 const ui::LatencyInfo& latency) {
2034 host_->ForwardTouchEventWithLatencyInfo(event, latency); 2034 host_->ForwardTouchEventWithLatencyInfo(event, latency);
2035 } 2035 }
2036 2036
2037 void RenderWidgetHostViewAura::ProcessGestureEvent( 2037 void RenderWidgetHostViewAura::ProcessGestureEvent(
2038 const blink::WebGestureEvent& event, 2038 const blink::WebGestureEvent& event,
2039 const ui::LatencyInfo& latency) { 2039 const ui::LatencyInfo& latency) {
2040 host_->ForwardGestureEventWithLatencyInfo(event, latency); 2040 host_->ForwardGestureEventWithLatencyInfo(event, latency);
2041 } 2041 }
2042 2042
2043 void RenderWidgetHostViewAura::TransformPointToLocalCoordSpace( 2043 gfx::Point RenderWidgetHostViewAura::TransformPointToLocalCoordSpace(
2044 const gfx::Point& point, 2044 const gfx::Point& point,
2045 const cc::SurfaceId& original_surface, 2045 const cc::SurfaceId& original_surface) {
2046 gfx::Point* transformed_point) { 2046 gfx::Point transformed_point;
2047 // Transformations use physical pixels rather than DIP, so conversion 2047 // Transformations use physical pixels rather than DIP, so conversion
2048 // is necessary. 2048 // is necessary.
2049 gfx::Point point_in_pixels = 2049 gfx::Point point_in_pixels =
2050 gfx::ConvertPointToPixel(device_scale_factor_, point); 2050 gfx::ConvertPointToPixel(device_scale_factor_, point);
2051 delegated_frame_host_->TransformPointToLocalCoordSpace( 2051 transformed_point = delegated_frame_host_->TransformPointToLocalCoordSpace(
2052 point_in_pixels, original_surface, transformed_point); 2052 point_in_pixels, original_surface);
2053 *transformed_point = 2053 return gfx::ConvertPointToDIP(device_scale_factor_, transformed_point);
2054 gfx::ConvertPointToDIP(device_scale_factor_, *transformed_point); 2054 }
2055
2056 gfx::Point RenderWidgetHostViewAura::TransformPointToCoordSpaceForView(
2057 const gfx::Point& point,
2058 RenderWidgetHostViewBase* target_view) {
2059 // In TransformPointToLocalCoordSpace() there is a Point-to-Pixel conversion,
2060 // but it is not necessary here because the final target view is responsible
2061 // for converting before computing the final transform.
2062 return delegated_frame_host_->TransformPointToCoordSpaceForView(point,
2063 target_view);
lfg 2016/07/28 19:58:58 nit: indent.
2055 } 2064 }
2056 2065
2057 void RenderWidgetHostViewAura::FocusedNodeChanged(bool editable) { 2066 void RenderWidgetHostViewAura::FocusedNodeChanged(bool editable) {
2058 #if defined(OS_WIN) 2067 #if defined(OS_WIN)
2059 if (!editable && virtual_keyboard_requested_) { 2068 if (!editable && virtual_keyboard_requested_) {
2060 virtual_keyboard_requested_ = false; 2069 virtual_keyboard_requested_ = false;
2061 2070
2062 RenderViewHost* rvh = RenderViewHost::From(host_); 2071 RenderViewHost* rvh = RenderViewHost::From(host_);
2063 if (rvh && rvh->GetDelegate()) 2072 if (rvh && rvh->GetDelegate())
2064 rvh->GetDelegate()->SetIsVirtualKeyboardRequested(false); 2073 rvh->GetDelegate()->SetIsVirtualKeyboardRequested(false);
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
3001 3010
3002 //////////////////////////////////////////////////////////////////////////////// 3011 ////////////////////////////////////////////////////////////////////////////////
3003 // RenderWidgetHostViewBase, public: 3012 // RenderWidgetHostViewBase, public:
3004 3013
3005 // static 3014 // static
3006 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 3015 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
3007 GetScreenInfoForWindow(results, NULL); 3016 GetScreenInfoForWindow(results, NULL);
3008 } 3017 }
3009 3018
3010 } // namespace content 3019 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698