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_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <OpenGL/gl.h> | 8 #include <OpenGL/gl.h> |
9 #include <QuartzCore/QuartzCore.h> | 9 #include <QuartzCore/QuartzCore.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 .device_scale_factor(); | 1632 .device_scale_factor(); |
1633 gfx::Point point_in_pixels = gfx::ConvertPointToPixel(scale_factor, point); | 1633 gfx::Point point_in_pixels = gfx::ConvertPointToPixel(scale_factor, point); |
1634 cc::SurfaceId id = delegated_frame_host_->SurfaceIdAtPoint( | 1634 cc::SurfaceId id = delegated_frame_host_->SurfaceIdAtPoint( |
1635 delegate, point_in_pixels, transformed_point); | 1635 delegate, point_in_pixels, transformed_point); |
1636 *transformed_point = gfx::ConvertPointToDIP(scale_factor, *transformed_point); | 1636 *transformed_point = gfx::ConvertPointToDIP(scale_factor, *transformed_point); |
1637 | 1637 |
1638 // It is possible that the renderer has not yet produced a surface, in which | 1638 // It is possible that the renderer has not yet produced a surface, in which |
1639 // case we return our current namespace. | 1639 // case we return our current namespace. |
1640 if (id.is_null()) | 1640 if (id.is_null()) |
1641 return GetSurfaceIdNamespace(); | 1641 return GetSurfaceIdNamespace(); |
1642 return cc::SurfaceIdAllocator::NamespaceForId(id); | 1642 return id.id_namespace(); |
1643 } | 1643 } |
1644 | 1644 |
1645 bool RenderWidgetHostViewMac::ShouldRouteEvent( | 1645 bool RenderWidgetHostViewMac::ShouldRouteEvent( |
1646 const WebInputEvent& event) const { | 1646 const WebInputEvent& event) const { |
1647 // See also RenderWidgetHostViewAura::ShouldRouteEvent. | 1647 // See also RenderWidgetHostViewAura::ShouldRouteEvent. |
1648 // TODO(wjmaclean): Update this function if RenderWidgetHostViewMac implements | 1648 // TODO(wjmaclean): Update this function if RenderWidgetHostViewMac implements |
1649 // OnTouchEvent(), to match what we are doing in RenderWidgetHostViewAura. | 1649 // OnTouchEvent(), to match what we are doing in RenderWidgetHostViewAura. |
1650 DCHECK(WebInputEvent::isMouseEventType(event.type) || | 1650 DCHECK(WebInputEvent::isMouseEventType(event.type) || |
1651 event.type == WebInputEvent::MouseWheel); | 1651 event.type == WebInputEvent::MouseWheel); |
1652 return render_widget_host_->delegate() && | 1652 return render_widget_host_->delegate() && |
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3450 | 3450 |
3451 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3451 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3452 // regions that are not draggable. (See ControlRegionView in | 3452 // regions that are not draggable. (See ControlRegionView in |
3453 // native_app_window_cocoa.mm). This requires the render host view to be | 3453 // native_app_window_cocoa.mm). This requires the render host view to be |
3454 // draggable by default. | 3454 // draggable by default. |
3455 - (BOOL)mouseDownCanMoveWindow { | 3455 - (BOOL)mouseDownCanMoveWindow { |
3456 return YES; | 3456 return YES; |
3457 } | 3457 } |
3458 | 3458 |
3459 @end | 3459 @end |
OLD | NEW |