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

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

Issue 630363003: More NativeWidget -> Widget notifications: visibility, minimize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20140704-Mac-VIEWS-ActivationChanges
Patch Set: rebase on crrev/654393002 Created 6 years, 2 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 | « ui/views/cocoa/views_nswindow_delegate.h ('k') | ui/views/views.gyp » ('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/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_content_view.h"
9 #import "ui/views/cocoa/bridged_native_widget.h" 9 #import "ui/views/cocoa/bridged_native_widget.h"
10 #include "ui/views/widget/native_widget_mac.h" 10 #include "ui/views/widget/native_widget_mac.h"
(...skipping 10 matching lines...) Expand all
21 21
22 - (views::NativeWidgetMac*)nativeWidgetMac { 22 - (views::NativeWidgetMac*)nativeWidgetMac {
23 return parent_->native_widget_mac(); 23 return parent_->native_widget_mac();
24 } 24 }
25 25
26 - (void)onWindowOrderWillChange:(NSWindowOrderingMode)orderingMode { 26 - (void)onWindowOrderWillChange:(NSWindowOrderingMode)orderingMode {
27 if (orderingMode != NSWindowOut) 27 if (orderingMode != NSWindowOut)
28 [parent_->ns_view() setWillShow:YES]; 28 [parent_->ns_view() setWillShow:YES];
29 } 29 }
30 30
31 - (void)onWindowOrderChanged { 31 - (void)onWindowOrderChanged:(NSNotification*)notification {
32 [parent_->ns_view() setWillShow:NO]; 32 [parent_->ns_view() setWillShow:NO];
33 parent_->OnVisibilityChanged();
33 } 34 }
34 35
35 // NSWindowDelegate implementation. 36 // NSWindowDelegate implementation.
36 37
37 - (void)windowDidFailToEnterFullScreen:(NSWindow*)window { 38 - (void)windowDidFailToEnterFullScreen:(NSWindow*)window {
38 // Cocoa should already have sent an (unexpected) windowDidExitFullScreen: 39 // Cocoa should already have sent an (unexpected) windowDidExitFullScreen:
39 // notification, and the attempt to get back into fullscreen should fail. 40 // notification, and the attempt to get back into fullscreen should fail.
40 // Nothing to do except verify |parent_| is no longer trying to fullscreen. 41 // Nothing to do except verify |parent_| is no longer trying to fullscreen.
41 DCHECK(!parent_->target_fullscreen_state()); 42 DCHECK(!parent_->target_fullscreen_state());
42 } 43 }
(...skipping 14 matching lines...) Expand all
57 - (void)windowDidResignKey:(NSNotification*)notification { 58 - (void)windowDidResignKey:(NSNotification*)notification {
58 parent_->native_widget_mac()->GetWidget()->OnNativeWidgetActivationChanged( 59 parent_->native_widget_mac()->GetWidget()->OnNativeWidgetActivationChanged(
59 false); 60 false);
60 } 61 }
61 62
62 - (void)windowWillClose:(NSNotification*)notification { 63 - (void)windowWillClose:(NSNotification*)notification {
63 DCHECK([parent_->ns_window() isEqual:[notification object]]); 64 DCHECK([parent_->ns_window() isEqual:[notification object]]);
64 parent_->OnWindowWillClose(); 65 parent_->OnWindowWillClose();
65 } 66 }
66 67
68 - (void)windowDidMiniaturize:(NSNotification*)notification {
69 parent_->OnVisibilityChanged();
70 }
71
72 - (void)windowDidDeminiaturize:(NSNotification*)notification {
73 parent_->OnVisibilityChanged();
74 }
75
67 - (void)windowWillEnterFullScreen:(NSNotification*)notification { 76 - (void)windowWillEnterFullScreen:(NSNotification*)notification {
68 parent_->OnFullscreenTransitionStart(true); 77 parent_->OnFullscreenTransitionStart(true);
69 } 78 }
70 79
71 - (void)windowDidEnterFullScreen:(NSNotification*)notification { 80 - (void)windowDidEnterFullScreen:(NSNotification*)notification {
72 parent_->OnFullscreenTransitionComplete(true); 81 parent_->OnFullscreenTransitionComplete(true);
73 } 82 }
74 83
75 - (void)windowWillExitFullScreen:(NSNotification*)notification { 84 - (void)windowWillExitFullScreen:(NSNotification*)notification {
76 parent_->OnFullscreenTransitionStart(false); 85 parent_->OnFullscreenTransitionStart(false);
77 } 86 }
78 87
79 - (void)windowDidExitFullScreen:(NSNotification*)notification { 88 - (void)windowDidExitFullScreen:(NSNotification*)notification {
80 parent_->OnFullscreenTransitionComplete(false); 89 parent_->OnFullscreenTransitionComplete(false);
81 } 90 }
82 91
83 @end 92 @end
OLDNEW
« no previous file with comments | « ui/views/cocoa/views_nswindow_delegate.h ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698