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

Side by Side Diff: ui/message_center/cocoa/tray_view_controller.mm

Issue 324583002: The 1st patch to disambiguate message center notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
OLDNEW
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
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([notification notificationID ]))
665 continue; 665 continue;
666 [notificationsPendingRemoval_ addObject:notification]; 666 [notificationsPendingRemoval_ addObject:notification];
667 [animationDataArray addObject:@{ 667 [animationDataArray addObject:@{
668 NSViewAnimationTargetKey : [notification view], 668 NSViewAnimationTargetKey : [notification view],
669 NSViewAnimationEffectKey : NSViewAnimationFadeOutEffect 669 NSViewAnimationEffectKey : NSViewAnimationFadeOutEffect
670 }]; 670 }];
671 } 671 }
672 672
673 if ([notificationsPendingRemoval_ count] == 0) 673 if ([notificationsPendingRemoval_ count] == 0)
674 return; 674 return;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 [pauseButton_ setDefaultImage: rb.GetNativeImageNamed( 800 [pauseButton_ setDefaultImage: rb.GetNativeImageNamed(
801 IDR_NOTIFICATION_DO_NOT_DISTURB_PRESSED).ToNSImage()]; 801 IDR_NOTIFICATION_DO_NOT_DISTURB_PRESSED).ToNSImage()];
802 } else { 802 } else {
803 [pauseButton_ setTrackingEnabled:YES]; 803 [pauseButton_ setTrackingEnabled:YES];
804 [pauseButton_ setDefaultImage: 804 [pauseButton_ setDefaultImage:
805 rb.GetNativeImageNamed(IDR_NOTIFICATION_DO_NOT_DISTURB).ToNSImage()]; 805 rb.GetNativeImageNamed(IDR_NOTIFICATION_DO_NOT_DISTURB).ToNSImage()];
806 } 806 }
807 } 807 }
808 808
809 @end 809 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698