| 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 3336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3347 NSScreen* screen = [[self window] screen]; | 3347 NSScreen* screen = [[self window] screen]; |
| 3348 if (screen) { | 3348 if (screen) { |
| 3349 CGColorSpaceRef color_space = [[screen colorSpace] CGColorSpace]; | 3349 CGColorSpaceRef color_space = [[screen colorSpace] CGColorSpace]; |
| 3350 // On Sierra, we need to operate in a single screen's color space because | 3350 // On Sierra, we need to operate in a single screen's color space because |
| 3351 // IOSurfaces do not opt-out of color correction. | 3351 // IOSurfaces do not opt-out of color correction. |
| 3352 // https://crbug.com/654488 | 3352 // https://crbug.com/654488 |
| 3353 if (base::mac::IsAtLeastOS10_12()) | 3353 if (base::mac::IsAtLeastOS10_12()) |
| 3354 color_space = base::mac::GetSystemColorSpace(); | 3354 color_space = base::mac::GetSystemColorSpace(); |
| 3355 gfx::ICCProfile icc_profile = | 3355 gfx::ICCProfile icc_profile = |
| 3356 gfx::ICCProfile::FromCGColorSpace(color_space); | 3356 gfx::ICCProfile::FromCGColorSpace(color_space); |
| 3357 renderWidgetHostView_->browser_compositor_->SetDisplayColorProfile( | 3357 renderWidgetHostView_->browser_compositor_->SetDisplayColorSpace( |
| 3358 icc_profile); | 3358 icc_profile.GetColorSpace()); |
| 3359 } | 3359 } |
| 3360 } | 3360 } |
| 3361 | 3361 |
| 3362 - (void)undo:(id)sender { | 3362 - (void)undo:(id)sender { |
| 3363 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); | 3363 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); |
| 3364 if (web_contents) | 3364 if (web_contents) |
| 3365 web_contents->Undo(); | 3365 web_contents->Undo(); |
| 3366 } | 3366 } |
| 3367 | 3367 |
| 3368 - (void)redo:(id)sender { | 3368 - (void)redo:(id)sender { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3528 | 3528 |
| 3529 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3529 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3530 // regions that are not draggable. (See ControlRegionView in | 3530 // regions that are not draggable. (See ControlRegionView in |
| 3531 // native_app_window_cocoa.mm). This requires the render host view to be | 3531 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3532 // draggable by default. | 3532 // draggable by default. |
| 3533 - (BOOL)mouseDownCanMoveWindow { | 3533 - (BOOL)mouseDownCanMoveWindow { |
| 3534 return YES; | 3534 return YES; |
| 3535 } | 3535 } |
| 3536 | 3536 |
| 3537 @end | 3537 @end |
| OLD | NEW |