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/views_nswindow_delegate.h" | 5 #import "ui/views/cocoa/views_nswindow_delegate.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "ui/views/cocoa/bridged_content_view.h" |
8 #import "ui/views/cocoa/bridged_native_widget.h" | 9 #import "ui/views/cocoa/bridged_native_widget.h" |
9 #include "ui/views/widget/native_widget_mac.h" | 10 #include "ui/views/widget/native_widget_mac.h" |
10 | 11 |
11 @implementation ViewsNSWindowDelegate | 12 @implementation ViewsNSWindowDelegate |
12 | 13 |
13 - (id)initWithBridgedNativeWidget:(views::BridgedNativeWidget*)parent { | 14 - (id)initWithBridgedNativeWidget:(views::BridgedNativeWidget*)parent { |
14 DCHECK(parent); | 15 DCHECK(parent); |
15 if ((self = [super init])) { | 16 if ((self = [super init])) { |
16 parent_ = parent; | 17 parent_ = parent; |
17 } | 18 } |
18 return self; | 19 return self; |
19 } | 20 } |
20 | 21 |
21 - (views::NativeWidgetMac*)nativeWidgetMac { | 22 - (views::NativeWidgetMac*)nativeWidgetMac { |
22 return parent_->native_widget_mac(); | 23 return parent_->native_widget_mac(); |
23 } | 24 } |
24 | 25 |
| 26 - (void)onWindowOrderWillChange:(NSWindowOrderingMode)orderingMode { |
| 27 if (orderingMode != NSWindowOut) |
| 28 [parent_->ns_view() setWillShow:YES]; |
| 29 } |
| 30 |
| 31 - (void)onWindowOrderChanged { |
| 32 [parent_->ns_view() setWillShow:NO]; |
| 33 } |
| 34 |
25 // NSWindowDelegate implementation. | 35 // NSWindowDelegate implementation. |
26 | 36 |
27 - (void)windowDidFailToEnterFullScreen:(NSWindow*)window { | 37 - (void)windowDidFailToEnterFullScreen:(NSWindow*)window { |
28 // Cocoa should already have sent an (unexpected) windowDidExitFullScreen: | 38 // Cocoa should already have sent an (unexpected) windowDidExitFullScreen: |
29 // notification, and the attempt to get back into fullscreen should fail. | 39 // notification, and the attempt to get back into fullscreen should fail. |
30 // Nothing to do except verify |parent_| is no longer trying to fullscreen. | 40 // Nothing to do except verify |parent_| is no longer trying to fullscreen. |
31 DCHECK(!parent_->target_fullscreen_state()); | 41 DCHECK(!parent_->target_fullscreen_state()); |
32 } | 42 } |
33 | 43 |
34 - (void)windowDidFailToExitFullScreen:(NSWindow*)window { | 44 - (void)windowDidFailToExitFullScreen:(NSWindow*)window { |
(...skipping 29 matching lines...) Expand all Loading... |
64 | 74 |
65 - (void)windowWillExitFullScreen:(NSNotification*)notification { | 75 - (void)windowWillExitFullScreen:(NSNotification*)notification { |
66 parent_->OnFullscreenTransitionStart(false); | 76 parent_->OnFullscreenTransitionStart(false); |
67 } | 77 } |
68 | 78 |
69 - (void)windowDidExitFullScreen:(NSNotification*)notification { | 79 - (void)windowDidExitFullScreen:(NSNotification*)notification { |
70 parent_->OnFullscreenTransitionComplete(false); | 80 parent_->OnFullscreenTransitionComplete(false); |
71 } | 81 } |
72 | 82 |
73 @end | 83 @end |
OLD | NEW |