Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 1996783002: Make cc::SurfaceId unguessable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Ben's comment Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/renderer/browser_plugin/browser_plugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698