| 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 3227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3238 event.button = WebMouseEvent::Button::Left; | 3238 event.button = WebMouseEvent::Button::Left; |
| 3239 renderWidgetHostView_->ForwardMouseEvent(event); | 3239 renderWidgetHostView_->ForwardMouseEvent(event); |
| 3240 | 3240 |
| 3241 hasOpenMouseDown_ = NO; | 3241 hasOpenMouseDown_ = NO; |
| 3242 } | 3242 } |
| 3243 } | 3243 } |
| 3244 | 3244 |
| 3245 - (void)viewDidChangeBackingProperties { | 3245 - (void)viewDidChangeBackingProperties { |
| 3246 NSScreen* screen = [[self window] screen]; | 3246 NSScreen* screen = [[self window] screen]; |
| 3247 if (screen) { | 3247 if (screen) { |
| 3248 CGColorSpaceRef color_space = [[screen colorSpace] CGColorSpace]; |
| 3249 // On Sierra, we need to operate in a single screen's color space because |
| 3250 // IOSurfaces do not opt-out of color correction. |
| 3251 // https://crbug.com/654488 |
| 3252 if (base::mac::IsAtLeastOS10_12()) |
| 3253 color_space = base::mac::GetSystemColorSpace(); |
| 3248 gfx::ICCProfile icc_profile = | 3254 gfx::ICCProfile icc_profile = |
| 3249 gfx::ICCProfile::FromCGColorSpace([[screen colorSpace] CGColorSpace]); | 3255 gfx::ICCProfile::FromCGColorSpace(color_space); |
| 3250 renderWidgetHostView_->browser_compositor_->SetDisplayColorSpace( | 3256 renderWidgetHostView_->browser_compositor_->SetDisplayColorSpace( |
| 3251 icc_profile.GetColorSpace()); | 3257 icc_profile.GetColorSpace()); |
| 3252 } | 3258 } |
| 3253 } | 3259 } |
| 3254 | 3260 |
| 3255 - (void)undo:(id)sender { | 3261 - (void)undo:(id)sender { |
| 3256 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); | 3262 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); |
| 3257 if (web_contents) | 3263 if (web_contents) |
| 3258 web_contents->Undo(); | 3264 web_contents->Undo(); |
| 3259 } | 3265 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3414 | 3420 |
| 3415 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3421 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3416 // regions that are not draggable. (See ControlRegionView in | 3422 // regions that are not draggable. (See ControlRegionView in |
| 3417 // native_app_window_cocoa.mm). This requires the render host view to be | 3423 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3418 // draggable by default. | 3424 // draggable by default. |
| 3419 - (BOOL)mouseDownCanMoveWindow { | 3425 - (BOOL)mouseDownCanMoveWindow { |
| 3420 return YES; | 3426 return YES; |
| 3421 } | 3427 } |
| 3422 | 3428 |
| 3423 @end | 3429 @end |
| OLD | NEW |