| 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 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 ->GetDisplayNearestWindow(cocoa_view_) | 1510 ->GetDisplayNearestWindow(cocoa_view_) |
| 1511 .device_scale_factor(); | 1511 .device_scale_factor(); |
| 1512 gfx::Point point_in_pixels = gfx::ConvertPointToPixel(scale_factor, point); | 1512 gfx::Point point_in_pixels = gfx::ConvertPointToPixel(scale_factor, point); |
| 1513 cc::SurfaceId id = | 1513 cc::SurfaceId id = |
| 1514 browser_compositor_->GetDelegatedFrameHost()->SurfaceIdAtPoint( | 1514 browser_compositor_->GetDelegatedFrameHost()->SurfaceIdAtPoint( |
| 1515 delegate, point_in_pixels, transformed_point); | 1515 delegate, point_in_pixels, transformed_point); |
| 1516 *transformed_point = gfx::ConvertPointToDIP(scale_factor, *transformed_point); | 1516 *transformed_point = gfx::ConvertPointToDIP(scale_factor, *transformed_point); |
| 1517 | 1517 |
| 1518 // It is possible that the renderer has not yet produced a surface, in which | 1518 // It is possible that the renderer has not yet produced a surface, in which |
| 1519 // case we return our current namespace. | 1519 // case we return our current namespace. |
| 1520 if (id.is_null()) | 1520 if (!id.is_valid()) |
| 1521 return GetFrameSinkId(); | 1521 return GetFrameSinkId(); |
| 1522 return id.frame_sink_id(); | 1522 return id.frame_sink_id(); |
| 1523 } | 1523 } |
| 1524 | 1524 |
| 1525 bool RenderWidgetHostViewMac::ShouldRouteEvent( | 1525 bool RenderWidgetHostViewMac::ShouldRouteEvent( |
| 1526 const WebInputEvent& event) const { | 1526 const WebInputEvent& event) const { |
| 1527 // See also RenderWidgetHostViewAura::ShouldRouteEvent. | 1527 // See also RenderWidgetHostViewAura::ShouldRouteEvent. |
| 1528 // TODO(wjmaclean): Update this function if RenderWidgetHostViewMac implements | 1528 // TODO(wjmaclean): Update this function if RenderWidgetHostViewMac implements |
| 1529 // OnTouchEvent(), to match what we are doing in RenderWidgetHostViewAura. | 1529 // OnTouchEvent(), to match what we are doing in RenderWidgetHostViewAura. |
| 1530 DCHECK(WebInputEvent::isMouseEventType(event.type) || | 1530 DCHECK(WebInputEvent::isMouseEventType(event.type) || |
| (...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3438 | 3438 |
| 3439 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3439 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3440 // regions that are not draggable. (See ControlRegionView in | 3440 // regions that are not draggable. (See ControlRegionView in |
| 3441 // native_app_window_cocoa.mm). This requires the render host view to be | 3441 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3442 // draggable by default. | 3442 // draggable by default. |
| 3443 - (BOOL)mouseDownCanMoveWindow { | 3443 - (BOOL)mouseDownCanMoveWindow { |
| 3444 return YES; | 3444 return YES; |
| 3445 } | 3445 } |
| 3446 | 3446 |
| 3447 @end | 3447 @end |
| OLD | NEW |