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