| 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/tray_view_controller.h" | 5 #import "ui/message_center/cocoa/tray_view_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/mac/scoped_nsautorelease_pool.h" | 9 #include "base/mac/scoped_nsautorelease_pool.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 return; | 654 return; |
| 655 [self hideNotificationsPendingRemoval]; | 655 [self hideNotificationsPendingRemoval]; |
| 656 } | 656 } |
| 657 | 657 |
| 658 - (void)hideNotificationsPendingRemoval { | 658 - (void)hideNotificationsPendingRemoval { |
| 659 base::scoped_nsobject<NSMutableArray> animationDataArray( | 659 base::scoped_nsobject<NSMutableArray> animationDataArray( |
| 660 [[NSMutableArray alloc] init]); | 660 [[NSMutableArray alloc] init]); |
| 661 | 661 |
| 662 // Fade-out those notifications pending removal. | 662 // Fade-out those notifications pending removal. |
| 663 for (MCNotificationController* notification in notifications_.get()) { | 663 for (MCNotificationController* notification in notifications_.get()) { |
| 664 if (messageCenter_->HasNotification([notification notificationID])) | 664 if (messageCenter_->FindVisibleNotificationById( |
| 665 [notification notificationID])) |
| 665 continue; | 666 continue; |
| 666 [notificationsPendingRemoval_ addObject:notification]; | 667 [notificationsPendingRemoval_ addObject:notification]; |
| 667 [animationDataArray addObject:@{ | 668 [animationDataArray addObject:@{ |
| 668 NSViewAnimationTargetKey : [notification view], | 669 NSViewAnimationTargetKey : [notification view], |
| 669 NSViewAnimationEffectKey : NSViewAnimationFadeOutEffect | 670 NSViewAnimationEffectKey : NSViewAnimationFadeOutEffect |
| 670 }]; | 671 }]; |
| 671 } | 672 } |
| 672 | 673 |
| 673 if ([notificationsPendingRemoval_ count] == 0) | 674 if ([notificationsPendingRemoval_ count] == 0) |
| 674 return; | 675 return; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 [pauseButton_ setDefaultImage: rb.GetNativeImageNamed( | 801 [pauseButton_ setDefaultImage: rb.GetNativeImageNamed( |
| 801 IDR_NOTIFICATION_DO_NOT_DISTURB_PRESSED).ToNSImage()]; | 802 IDR_NOTIFICATION_DO_NOT_DISTURB_PRESSED).ToNSImage()]; |
| 802 } else { | 803 } else { |
| 803 [pauseButton_ setTrackingEnabled:YES]; | 804 [pauseButton_ setTrackingEnabled:YES]; |
| 804 [pauseButton_ setDefaultImage: | 805 [pauseButton_ setDefaultImage: |
| 805 rb.GetNativeImageNamed(IDR_NOTIFICATION_DO_NOT_DISTURB).ToNSImage()]; | 806 rb.GetNativeImageNamed(IDR_NOTIFICATION_DO_NOT_DISTURB).ToNSImage()]; |
| 806 } | 807 } |
| 807 } | 808 } |
| 808 | 809 |
| 809 @end | 810 @end |
| OLD | NEW |