| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |