Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ui/views/cocoa/native_widget_mac_nswindow.h" | 5 #import "ui/views/cocoa/native_widget_mac_nswindow.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #import "base/mac/sdk_forward_declarations.h" | 8 #import "base/mac/sdk_forward_declarations.h" |
| 9 #import "ui/views/cocoa/bridged_native_widget.h" | 9 #import "ui/views/cocoa/bridged_native_widget.h" |
| 10 #import "ui/base/cocoa/user_interface_item_command_handler.h" | 10 #import "ui/base/cocoa/user_interface_item_command_handler.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 } | 34 } |
| 35 | 35 |
| 36 - (instancetype)initWithContentRect:(NSRect)contentRect | 36 - (instancetype)initWithContentRect:(NSRect)contentRect |
| 37 styleMask:(NSUInteger)windowStyle | 37 styleMask:(NSUInteger)windowStyle |
| 38 backing:(NSBackingStoreType)bufferingType | 38 backing:(NSBackingStoreType)bufferingType |
| 39 defer:(BOOL)deferCreation { | 39 defer:(BOOL)deferCreation { |
| 40 if ((self = [super initWithContentRect:contentRect | 40 if ((self = [super initWithContentRect:contentRect |
| 41 styleMask:windowStyle | 41 styleMask:windowStyle |
| 42 backing:bufferingType | 42 backing:bufferingType |
| 43 defer:deferCreation])) { | 43 defer:deferCreation])) { |
| 44 static_cast<NSView*>(self.contentView).wantsLayer = YES; | |
|
tapted
2017/01/13 00:22:37
ooh neat - I think this might fix http://crbug.com
| |
| 44 commandDispatcher_.reset([[CommandDispatcher alloc] initWithOwner:self]); | 45 commandDispatcher_.reset([[CommandDispatcher alloc] initWithOwner:self]); |
| 45 } | 46 } |
| 46 return self; | 47 return self; |
| 47 } | 48 } |
| 48 | 49 |
| 49 // This override doesn't do anything, but keeping it helps diagnose lifetime | 50 // This override doesn't do anything, but keeping it helps diagnose lifetime |
| 50 // issues in crash stacktraces by inserting a symbol on NativeWidgetMacNSWindow. | 51 // issues in crash stacktraces by inserting a symbol on NativeWidgetMacNSWindow. |
| 51 - (void)dealloc { | 52 - (void)dealloc { |
| 52 [super dealloc]; | 53 [super dealloc]; |
| 53 } | 54 } |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 id appController = [NSApp delegate]; | 221 id appController = [NSApp delegate]; |
| 221 DCHECK([appController | 222 DCHECK([appController |
| 222 conformsToProtocol:@protocol(NSUserInterfaceValidations)]); | 223 conformsToProtocol:@protocol(NSUserInterfaceValidations)]); |
| 223 return [appController validateUserInterfaceItem:item]; | 224 return [appController validateUserInterfaceItem:item]; |
| 224 } | 225 } |
| 225 | 226 |
| 226 return [super validateUserInterfaceItem:item]; | 227 return [super validateUserInterfaceItem:item]; |
| 227 } | 228 } |
| 228 | 229 |
| 229 @end | 230 @end |
| OLD | NEW |