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 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 !(event->flags() & ui::EF_FROM_TOUCH)) { | 2204 !(event->flags() & ui::EF_FROM_TOUCH)) { |
2205 event->ConvertLocationToTarget(window_, window_->parent()); | 2205 event->ConvertLocationToTarget(window_, window_->parent()); |
2206 window_->parent()->delegate()->OnMouseEvent(event); | 2206 window_->parent()->delegate()->OnMouseEvent(event); |
2207 } | 2207 } |
2208 | 2208 |
2209 if (!IsXButtonUpEvent(event)) | 2209 if (!IsXButtonUpEvent(event)) |
2210 event->SetHandled(); | 2210 event->SetHandled(); |
2211 } | 2211 } |
2212 | 2212 |
2213 uint32_t RenderWidgetHostViewAura::SurfaceIdNamespaceAtPoint( | 2213 uint32_t RenderWidgetHostViewAura::SurfaceIdNamespaceAtPoint( |
2214 cc::SurfaceHittestDelegate* delegate, | |
2215 const gfx::Point& point, | 2214 const gfx::Point& point, |
2216 gfx::Point* transformed_point) { | 2215 gfx::Point* transformed_point) { |
2217 DCHECK(device_scale_factor_ != 0.0f); | 2216 DCHECK(device_scale_factor_ != 0.0f); |
2218 | 2217 |
2219 // The surface hittest happens in device pixels, so we need to convert the | 2218 // The surface hittest happens in device pixels, so we need to convert the |
2220 // |point| from DIPs to pixels before hittesting. | 2219 // |point| from DIPs to pixels before hittesting. |
2221 gfx::Point point_in_pixels = | 2220 gfx::Point point_in_pixels = |
2222 gfx::ConvertPointToPixel(device_scale_factor_, point); | 2221 gfx::ConvertPointToPixel(device_scale_factor_, point); |
2223 cc::SurfaceId id = delegated_frame_host_->SurfaceIdAtPoint( | 2222 cc::SurfaceId id = delegated_frame_host_->SurfaceIdAtPoint(point_in_pixels, |
2224 delegate, point_in_pixels, transformed_point); | 2223 transformed_point); |
2225 *transformed_point = | 2224 *transformed_point = |
2226 gfx::ConvertPointToDIP(device_scale_factor_, *transformed_point); | 2225 gfx::ConvertPointToDIP(device_scale_factor_, *transformed_point); |
2227 | 2226 |
2228 // It is possible that the renderer has not yet produced a surface, in which | 2227 // It is possible that the renderer has not yet produced a surface, in which |
2229 // case we return our current namespace. | 2228 // case we return our current namespace. |
2230 if (id.is_null()) | 2229 if (id.is_null()) |
2231 return GetSurfaceIdNamespace(); | 2230 return GetSurfaceIdNamespace(); |
2232 return cc::SurfaceIdAllocator::NamespaceForId(id); | 2231 return cc::SurfaceIdAllocator::NamespaceForId(id); |
2233 } | 2232 } |
2234 | 2233 |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3079 | 3078 |
3080 //////////////////////////////////////////////////////////////////////////////// | 3079 //////////////////////////////////////////////////////////////////////////////// |
3081 // RenderWidgetHostViewBase, public: | 3080 // RenderWidgetHostViewBase, public: |
3082 | 3081 |
3083 // static | 3082 // static |
3084 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 3083 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
3085 GetScreenInfoForWindow(results, NULL); | 3084 GetScreenInfoForWindow(results, NULL); |
3086 } | 3085 } |
3087 | 3086 |
3088 } // namespace content | 3087 } // namespace content |
OLD | NEW |