| 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 <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 3041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3052 event.button = WebMouseEvent::ButtonLeft; | 3052 event.button = WebMouseEvent::ButtonLeft; |
| 3053 renderWidgetHostView_->ForwardMouseEvent(event); | 3053 renderWidgetHostView_->ForwardMouseEvent(event); |
| 3054 | 3054 |
| 3055 hasOpenMouseDown_ = NO; | 3055 hasOpenMouseDown_ = NO; |
| 3056 } | 3056 } |
| 3057 } | 3057 } |
| 3058 | 3058 |
| 3059 - (void)viewDidChangeBackingProperties { | 3059 - (void)viewDidChangeBackingProperties { |
| 3060 NSScreen* screen = [[self window] screen]; | 3060 NSScreen* screen = [[self window] screen]; |
| 3061 if (screen) { | 3061 if (screen) { |
| 3062 gfx::ICCProfile icc_profile = |
| 3063 gfx::ICCProfile::FromCGColorSpace([[screen colorSpace] CGColorSpace]); |
| 3062 renderWidgetHostView_->browser_compositor_->SetDisplayColorSpace( | 3064 renderWidgetHostView_->browser_compositor_->SetDisplayColorSpace( |
| 3063 gfx::ColorSpace::FromCGColorSpace([[screen colorSpace] CGColorSpace])); | 3065 icc_profile.GetColorSpace()); |
| 3064 } | 3066 } |
| 3065 } | 3067 } |
| 3066 | 3068 |
| 3067 - (void)undo:(id)sender { | 3069 - (void)undo:(id)sender { |
| 3068 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); | 3070 WebContents* web_contents = renderWidgetHostView_->GetWebContents(); |
| 3069 if (web_contents) | 3071 if (web_contents) |
| 3070 web_contents->Undo(); | 3072 web_contents->Undo(); |
| 3071 } | 3073 } |
| 3072 | 3074 |
| 3073 - (void)redo:(id)sender { | 3075 - (void)redo:(id)sender { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3235 | 3237 |
| 3236 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3238 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3237 // regions that are not draggable. (See ControlRegionView in | 3239 // regions that are not draggable. (See ControlRegionView in |
| 3238 // native_app_window_cocoa.mm). This requires the render host view to be | 3240 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3239 // draggable by default. | 3241 // draggable by default. |
| 3240 - (BOOL)mouseDownCanMoveWindow { | 3242 - (BOOL)mouseDownCanMoveWindow { |
| 3241 return YES; | 3243 return YES; |
| 3242 } | 3244 } |
| 3243 | 3245 |
| 3244 @end | 3246 @end |
| OLD | NEW |