Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: ui/views/cocoa/native_widget_mac_nswindow.mm

Issue 2056593002: Mac: Retain the child NSWindow in WidgetOwnerNSWindowAdapter before invoking close (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refine DCHECK Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/cocoa/widget_owner_nswindow_adapter.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ui/views/cocoa/widget_owner_nswindow_adapter.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698