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

Side by Side Diff: ui/views/widget/native_widget_mac.mm

Issue 1291763005: [MacViews] Use NSTitledWindowMask for window modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | no next file » | 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 #include "ui/views/widget/native_widget_mac.h" 5 #include "ui/views/widget/native_widget_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 + (void)closeWindowWithAnimation:(NSWindow*)window; 33 + (void)closeWindowWithAnimation:(NSWindow*)window;
34 34
35 @end 35 @end
36 36
37 namespace views { 37 namespace views {
38 namespace { 38 namespace {
39 39
40 NSInteger StyleMaskForParams(const Widget::InitParams& params) { 40 NSInteger StyleMaskForParams(const Widget::InitParams& params) {
41 // If the widget is modal, it will be displayed as a sheet. This only works
tapted 2015/08/19 09:02:14 nit: widget -> Widget (and perhaps "only works" ->
jackhou1 2015/08/20 00:01:36 Done.
42 // if it has NSTitledWindowMask.
tapted 2015/08/19 09:02:14 nit: perhaps worth adding "(e.g. with NSBorderless
jackhou1 2015/08/20 00:01:36 Done.
43 if (params.delegate->GetModalType() == ui::MODAL_TYPE_WINDOW)
tapted 2015/08/19 09:02:14 params.delegate && ... (params.delegate can be n
jackhou1 2015/08/20 00:01:36 Done.
44 return NSTitledWindowMask;
45
41 // TODO(tapted): Determine better masks when there are use cases for it. 46 // TODO(tapted): Determine better masks when there are use cases for it.
42 if (params.remove_standard_frame) 47 if (params.remove_standard_frame)
43 return NSBorderlessWindowMask; 48 return NSBorderlessWindowMask;
44 49
45 if (params.type == Widget::InitParams::TYPE_WINDOW) { 50 if (params.type == Widget::InitParams::TYPE_WINDOW) {
46 return NSTitledWindowMask | NSClosableWindowMask | 51 return NSTitledWindowMask | NSClosableWindowMask |
47 NSMiniaturizableWindowMask | NSResizableWindowMask | 52 NSMiniaturizableWindowMask | NSResizableWindowMask |
48 NSTexturedBackgroundWindowMask; 53 NSTexturedBackgroundWindowMask;
49 } 54 }
50 return NSBorderlessWindowMask; 55 return NSBorderlessWindowMask;
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; 705 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window];
701 } 706 }
702 707
703 - (void)animationDidEnd:(NSAnimation*)animation { 708 - (void)animationDidEnd:(NSAnimation*)animation {
704 [window_ close]; 709 [window_ close];
705 [animation_ setDelegate:nil]; 710 [animation_ setDelegate:nil];
706 [self release]; 711 [self release];
707 } 712 }
708 713
709 @end 714 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698