| 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 <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
| 8 #import <objc/runtime.h> | 8 #import <objc/runtime.h> |
| 9 #include <OpenGL/gl.h> | 9 #include <OpenGL/gl.h> |
| 10 #include <QuartzCore/QuartzCore.h> | 10 #include <QuartzCore/QuartzCore.h> |
| (...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1512 ->GetDisplayNearestWindow(cocoa_view_) | 1512 ->GetDisplayNearestWindow(cocoa_view_) |
| 1513 .device_scale_factor(); | 1513 .device_scale_factor(); |
| 1514 gfx::Point point_in_pixels = gfx::ConvertPointToPixel(scale_factor, point); | 1514 gfx::Point point_in_pixels = gfx::ConvertPointToPixel(scale_factor, point); |
| 1515 cc::SurfaceId id = | 1515 cc::SurfaceId id = |
| 1516 browser_compositor_->GetDelegatedFrameHost()->SurfaceIdAtPoint( | 1516 browser_compositor_->GetDelegatedFrameHost()->SurfaceIdAtPoint( |
| 1517 delegate, point_in_pixels, transformed_point); | 1517 delegate, point_in_pixels, transformed_point); |
| 1518 *transformed_point = gfx::ConvertPointToDIP(scale_factor, *transformed_point); | 1518 *transformed_point = gfx::ConvertPointToDIP(scale_factor, *transformed_point); |
| 1519 | 1519 |
| 1520 // It is possible that the renderer has not yet produced a surface, in which | 1520 // It is possible that the renderer has not yet produced a surface, in which |
| 1521 // case we return our current namespace. | 1521 // case we return our current namespace. |
| 1522 if (id.is_null()) | 1522 if (!id.is_valid()) |
| 1523 return GetFrameSinkId(); | 1523 return GetFrameSinkId(); |
| 1524 return id.frame_sink_id(); | 1524 return id.frame_sink_id(); |
| 1525 } | 1525 } |
| 1526 | 1526 |
| 1527 bool RenderWidgetHostViewMac::ShouldRouteEvent( | 1527 bool RenderWidgetHostViewMac::ShouldRouteEvent( |
| 1528 const WebInputEvent& event) const { | 1528 const WebInputEvent& event) const { |
| 1529 // See also RenderWidgetHostViewAura::ShouldRouteEvent. | 1529 // See also RenderWidgetHostViewAura::ShouldRouteEvent. |
| 1530 // TODO(wjmaclean): Update this function if RenderWidgetHostViewMac implements | 1530 // TODO(wjmaclean): Update this function if RenderWidgetHostViewMac implements |
| 1531 // OnTouchEvent(), to match what we are doing in RenderWidgetHostViewAura. | 1531 // OnTouchEvent(), to match what we are doing in RenderWidgetHostViewAura. |
| 1532 DCHECK(WebInputEvent::isMouseEventType(event.type) || | 1532 DCHECK(WebInputEvent::isMouseEventType(event.type) || |
| (...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3416 | 3416 |
| 3417 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3417 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3418 // regions that are not draggable. (See ControlRegionView in | 3418 // regions that are not draggable. (See ControlRegionView in |
| 3419 // native_app_window_cocoa.mm). This requires the render host view to be | 3419 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3420 // draggable by default. | 3420 // draggable by default. |
| 3421 - (BOOL)mouseDownCanMoveWindow { | 3421 - (BOOL)mouseDownCanMoveWindow { |
| 3422 return YES; | 3422 return YES; |
| 3423 } | 3423 } |
| 3424 | 3424 |
| 3425 @end | 3425 @end |
| OLD | NEW |