| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/message_center/cocoa/popup_controller.h" | 5 #import "ui/message_center/cocoa/popup_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
| 10 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 if (isClosing_) | 214 if (isClosing_) |
| 215 [self close]; | 215 [self close]; |
| 216 } | 216 } |
| 217 | 217 |
| 218 - (void)showWithAnimation:(NSRect)newBounds { | 218 - (void)showWithAnimation:(NSRect)newBounds { |
| 219 bounds_ = newBounds; | 219 bounds_ = newBounds; |
| 220 NSRect startBounds = newBounds; | 220 NSRect startBounds = newBounds; |
| 221 startBounds.origin.x += startBounds.size.width; | 221 startBounds.origin.x += startBounds.size.width; |
| 222 [[self window] setFrame:startBounds display:NO]; | 222 [[self window] setFrame:startBounds display:NO]; |
| 223 [[self window] setAlphaValue:0]; | 223 [[self window] setAlphaValue:0]; |
| 224 [[self window] setCanHide:NO]; |
| 224 [self showWindow:nil]; | 225 [self showWindow:nil]; |
| 225 | 226 |
| 226 // Slide-in and fade-in simultaneously. | 227 // Slide-in and fade-in simultaneously. |
| 227 NSDictionary* animationDict = @{ | 228 NSDictionary* animationDict = @{ |
| 228 NSViewAnimationTargetKey : [self window], | 229 NSViewAnimationTargetKey : [self window], |
| 229 NSViewAnimationEndFrameKey : [NSValue valueWithRect:newBounds], | 230 NSViewAnimationEndFrameKey : [NSValue valueWithRect:newBounds], |
| 230 NSViewAnimationEffectKey : NSViewAnimationFadeInEffect | 231 NSViewAnimationEffectKey : NSViewAnimationFadeInEffect |
| 231 }; | 232 }; |
| 232 NSViewAnimation* animation = [self animationWithDictionary:animationDict]; | 233 NSViewAnimation* animation = [self animationWithDictionary:animationDict]; |
| 233 [self setBoundsAnimation:animation]; | 234 [self setBoundsAnimation:animation]; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 290 |
| 290 - (void)mouseEntered:(NSEvent*)event { | 291 - (void)mouseEntered:(NSEvent*)event { |
| 291 messageCenter_->PausePopupTimers(); | 292 messageCenter_->PausePopupTimers(); |
| 292 } | 293 } |
| 293 | 294 |
| 294 - (void)mouseExited:(NSEvent*)event { | 295 - (void)mouseExited:(NSEvent*)event { |
| 295 messageCenter_->RestartPopupTimers(); | 296 messageCenter_->RestartPopupTimers(); |
| 296 } | 297 } |
| 297 | 298 |
| 298 @end | 299 @end |
| OLD | NEW |