OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_views_mac.h" | 5 #import "chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_views_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" | 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 - (void)updateSheetPosition { | 91 - (void)updateSheetPosition { |
92 ConstrainedWindowSheetController* controller = | 92 ConstrainedWindowSheetController* controller = |
93 [ConstrainedWindowSheetController controllerForSheet:self]; | 93 [ConstrainedWindowSheetController controllerForSheet:self]; |
94 NSPoint origin = [controller originForSheet:self | 94 NSPoint origin = [controller originForSheet:self |
95 withWindowSize:[customWindow_ frame].size]; | 95 withWindowSize:[customWindow_ frame].size]; |
96 [customWindow_ setFrameOrigin:origin]; | 96 [customWindow_ setFrameOrigin:origin]; |
97 } | 97 } |
98 | 98 |
99 - (void)resizeWithNewSize:(NSSize)size { | |
100 // NOOP | |
101 } | |
102 | |
103 - (NSWindow*)sheetWindow { | 99 - (NSWindow*)sheetWindow { |
104 return customWindow_; | 100 return customWindow_; |
105 } | 101 } |
106 | 102 |
107 @end | 103 @end |
108 | 104 |
109 SingleWebContentsDialogManagerViewsMac::SingleWebContentsDialogManagerViewsMac( | 105 SingleWebContentsDialogManagerViewsMac::SingleWebContentsDialogManagerViewsMac( |
110 NSWindow* dialog, | 106 NSWindow* dialog, |
111 web_modal::SingleWebContentsDialogManagerDelegate* delegate) | 107 web_modal::SingleWebContentsDialogManagerDelegate* delegate) |
112 : delegate_(delegate), host_(nullptr) { | 108 : delegate_(delegate), host_(nullptr) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 184 |
189 void SingleWebContentsDialogManagerViewsMac::OnWidgetDestroying( | 185 void SingleWebContentsDialogManagerViewsMac::OnWidgetDestroying( |
190 views::Widget* widget) { | 186 views::Widget* widget) { |
191 // On Mac, this would only be reached if something called -[NSWindow close] | 187 // On Mac, this would only be reached if something called -[NSWindow close] |
192 // on the dialog without going through Widget::Close or CloseNow(). Since | 188 // on the dialog without going through Widget::Close or CloseNow(). Since |
193 // dialogs have no titlebar, it won't come from the system. If something | 189 // dialogs have no titlebar, it won't come from the system. If something |
194 // internally calls -[NSWindow close] it might break lifetime assumptions | 190 // internally calls -[NSWindow close] it might break lifetime assumptions |
195 // made by DialogDelegate. | 191 // made by DialogDelegate. |
196 NOTREACHED(); | 192 NOTREACHED(); |
197 } | 193 } |
OLD | NEW |