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

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

Issue 1308553007: Convert MouseEvents from DIPS to Pixels before passing it to surfaces for hittesting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mac version Created 5 years, 3 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2160 window_->parent()->delegate()->OnMouseEvent(event); 2160 window_->parent()->delegate()->OnMouseEvent(event);
2161 } 2161 }
2162 2162
2163 if (!IsXButtonUpEvent(event)) 2163 if (!IsXButtonUpEvent(event))
2164 event->SetHandled(); 2164 event->SetHandled();
2165 } 2165 }
2166 2166
2167 uint32_t RenderWidgetHostViewAura::SurfaceIdNamespaceAtPoint( 2167 uint32_t RenderWidgetHostViewAura::SurfaceIdNamespaceAtPoint(
2168 const gfx::Point& point, 2168 const gfx::Point& point,
2169 gfx::Point* transformed_point) { 2169 gfx::Point* transformed_point) {
2170 cc::SurfaceId id = 2170 aura::WindowTreeHost* host = window_->GetHost();
2171 delegated_frame_host_->SurfaceIdAtPoint(point, transformed_point); 2171 gfx::Point point_in_pixels(point);
2172 host->GetRootTransform().TransformPoint(&point_in_pixels);
sadrul 2015/09/11 17:48:10 Does this do the right thing when the display is r
2173 cc::SurfaceId id = delegated_frame_host_->SurfaceIdAtPoint(point_in_pixels,
2174 transformed_point);
2175 host->GetInverseRootTransform().TransformPoint(transformed_point);
2176
2172 // It is possible that the renderer has not yet produced a surface, in which 2177 // It is possible that the renderer has not yet produced a surface, in which
2173 // case we return our current namespace. 2178 // case we return our current namespace.
2174 if (id.is_null()) 2179 if (id.is_null())
2175 return GetSurfaceIdNamespace(); 2180 return GetSurfaceIdNamespace();
2176 return cc::SurfaceIdAllocator::NamespaceForId(id); 2181 return cc::SurfaceIdAllocator::NamespaceForId(id);
2177 } 2182 }
2178 2183
2179 void RenderWidgetHostViewAura::ProcessMouseEvent( 2184 void RenderWidgetHostViewAura::ProcessMouseEvent(
2180 const blink::WebMouseEvent& event) { 2185 const blink::WebMouseEvent& event) {
2181 host_->ForwardMouseEvent(event); 2186 host_->ForwardMouseEvent(event);
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2882 2887
2883 //////////////////////////////////////////////////////////////////////////////// 2888 ////////////////////////////////////////////////////////////////////////////////
2884 // RenderWidgetHostViewBase, public: 2889 // RenderWidgetHostViewBase, public:
2885 2890
2886 // static 2891 // static
2887 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 2892 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
2888 GetScreenInfoForWindow(results, NULL); 2893 GetScreenInfoForWindow(results, NULL);
2889 } 2894 }
2890 2895
2891 } // namespace content 2896 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698