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

Side by Side Diff: chrome/browser/ui/cocoa/info_bubble_window.mm

Issue 944533004: Mac: Make bubble windows (not their controller) responsible for calling removeChildWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « chrome/browser/ui/cocoa/base_bubble_controller.mm ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/info_bubble_window.h" 5 #import "chrome/browser/ui/cocoa/info_bubble_window.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // |finishCloseAfterAnimation|. 178 // |finishCloseAfterAnimation|.
179 [NSAnimationContext beginGrouping]; 179 [NSAnimationContext beginGrouping];
180 [[NSAnimationContext currentContext] setDuration:kMinimumTimeInterval]; 180 [[NSAnimationContext currentContext] setDuration:kMinimumTimeInterval];
181 [[self animator] setAlphaValue:0.0]; 181 [[self animator] setAlphaValue:0.0];
182 [NSAnimationContext endGrouping]; 182 [NSAnimationContext endGrouping];
183 } 183 }
184 184
185 // Called by InfoBubbleWindowCloser when the window is to be really closed 185 // Called by InfoBubbleWindowCloser when the window is to be really closed
186 // after the fading animation is complete. 186 // after the fading animation is complete.
187 - (void)finishCloseAfterAnimation { 187 - (void)finishCloseAfterAnimation {
188 if (closing_) 188 if (closing_) {
189 [[self parentWindow] removeChildWindow:self];
189 [super close]; 190 [super close];
191 }
190 } 192 }
191 193
192 // Adds animation for info bubbles being ordered to the front. 194 // Adds animation for info bubbles being ordered to the front.
193 - (void)orderWindow:(NSWindowOrderingMode)orderingMode 195 - (void)orderWindow:(NSWindowOrderingMode)orderingMode
194 relativeTo:(NSInteger)otherWindowNumber { 196 relativeTo:(NSInteger)otherWindowNumber {
195 // According to the documentation '0' is the otherWindowNumber when the window 197 // According to the documentation '0' is the otherWindowNumber when the window
196 // is ordered front. 198 // is ordered front.
197 if (orderingMode == NSWindowAbove && otherWindowNumber == 0) { 199 if (orderingMode == NSWindowAbove && otherWindowNumber == 0) {
198 // Order self appropriately assuming that its alpha is zero as set up 200 // Order self appropriately assuming that its alpha is zero as set up
199 // in the designated initializer. 201 // in the designated initializer.
(...skipping 27 matching lines...) Expand all
227 - (void)sendEvent:(NSEvent*)theEvent { 229 - (void)sendEvent:(NSEvent*)theEvent {
228 if (!closing_) 230 if (!closing_)
229 [super sendEvent:theEvent]; 231 [super sendEvent:theEvent];
230 } 232 }
231 233
232 - (BOOL)isClosing { 234 - (BOOL)isClosing {
233 return closing_; 235 return closing_;
234 } 236 }
235 237
236 @end 238 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/base_bubble_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698