| 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 "ui/views/cocoa/bridged_native_widget.h" | 8 #import "ui/views/cocoa/bridged_native_widget.h" |
| 9 #import "ui/base/cocoa/user_interface_item_command_handler.h" | 9 #import "ui/base/cocoa/user_interface_item_command_handler.h" |
| 10 #import "ui/views/cocoa/views_nswindow_delegate.h" | 10 #import "ui/views/cocoa/views_nswindow_delegate.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 defer:(BOOL)deferCreation { | 38 defer:(BOOL)deferCreation { |
| 39 if ((self = [super initWithContentRect:contentRect | 39 if ((self = [super initWithContentRect:contentRect |
| 40 styleMask:windowStyle | 40 styleMask:windowStyle |
| 41 backing:bufferingType | 41 backing:bufferingType |
| 42 defer:deferCreation])) { | 42 defer:deferCreation])) { |
| 43 commandDispatcher_.reset([[CommandDispatcher alloc] initWithOwner:self]); | 43 commandDispatcher_.reset([[CommandDispatcher alloc] initWithOwner:self]); |
| 44 } | 44 } |
| 45 return self; | 45 return self; |
| 46 } | 46 } |
| 47 | 47 |
| 48 // This override doesn't do anything, but keeping it helps diagnose lifetime |
| 49 // issues in crash stacktraces by inserting a symbol on NativeWidgetMacNSWindow. |
| 50 - (void)dealloc { |
| 51 [super dealloc]; |
| 52 } |
| 53 |
| 48 // Public methods. | 54 // Public methods. |
| 49 | 55 |
| 50 - (void)setCommandDispatcherDelegate:(id<CommandDispatcherDelegate>)delegate { | 56 - (void)setCommandDispatcherDelegate:(id<CommandDispatcherDelegate>)delegate { |
| 51 [commandDispatcher_ setDelegate:delegate]; | 57 [commandDispatcher_ setDelegate:delegate]; |
| 52 } | 58 } |
| 53 | 59 |
| 54 // Private methods. | 60 // Private methods. |
| 55 | 61 |
| 56 - (ViewsNSWindowDelegate*)viewsNSWindowDelegate { | 62 - (ViewsNSWindowDelegate*)viewsNSWindowDelegate { |
| 57 return base::mac::ObjCCastStrict<ViewsNSWindowDelegate>([self delegate]); | 63 return base::mac::ObjCCastStrict<ViewsNSWindowDelegate>([self delegate]); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 id appController = [NSApp delegate]; | 215 id appController = [NSApp delegate]; |
| 210 DCHECK([appController | 216 DCHECK([appController |
| 211 conformsToProtocol:@protocol(NSUserInterfaceValidations)]); | 217 conformsToProtocol:@protocol(NSUserInterfaceValidations)]); |
| 212 return [appController validateUserInterfaceItem:item]; | 218 return [appController validateUserInterfaceItem:item]; |
| 213 } | 219 } |
| 214 | 220 |
| 215 return [super validateUserInterfaceItem:item]; | 221 return [super validateUserInterfaceItem:item]; |
| 216 } | 222 } |
| 217 | 223 |
| 218 @end | 224 @end |
| OLD | NEW |