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

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

Issue 264123002: Google Now Message Center Stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/message_center/cocoa/popup_collection.mm ('k') | ui/message_center/fake_message_center.h » ('j') | 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) 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 MCNotificationController* notification = nil; 198 MCNotificationController* notification = nil;
199 if (existing == notificationsMap_.end()) { 199 if (existing == notificationsMap_.end()) {
200 base::scoped_nsobject<MCNotificationController> controller( 200 base::scoped_nsobject<MCNotificationController> controller(
201 [[MCNotificationController alloc] 201 [[MCNotificationController alloc]
202 initWithNotification:*it 202 initWithNotification:*it
203 messageCenter:messageCenter_]); 203 messageCenter:messageCenter_]);
204 [[controller view] setShadow:shadow]; 204 [[controller view] setShadow:shadow];
205 [[scrollView_ documentView] addSubview:[controller view]]; 205 [[scrollView_ documentView] addSubview:[controller view]];
206 206
207 [notifications_ addObject:controller]; // Transfer ownership. 207 [notifications_ addObject:controller]; // Transfer ownership.
208 messageCenter_->DisplayedNotification((*it)->id()); 208 messageCenter_->DisplayedNotification(
209 (*it)->id(), message_center::DISPLAY_SOURCE_MESSAGE_CENTER);
209 210
210 notification = controller.get(); 211 notification = controller.get();
211 } else { 212 } else {
212 notification = existing->second; 213 notification = existing->second;
213 [notification updateNotification:*it]; 214 [notification updateNotification:*it];
214 notificationsMap_.erase(existing); 215 notificationsMap_.erase(existing);
215 } 216 }
216 217
217 DCHECK(notification); 218 DCHECK(notification);
218 219
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 [pauseButton_ setDefaultImage: rb.GetNativeImageNamed( 800 [pauseButton_ setDefaultImage: rb.GetNativeImageNamed(
800 IDR_NOTIFICATION_DO_NOT_DISTURB_PRESSED).ToNSImage()]; 801 IDR_NOTIFICATION_DO_NOT_DISTURB_PRESSED).ToNSImage()];
801 } else { 802 } else {
802 [pauseButton_ setTrackingEnabled:YES]; 803 [pauseButton_ setTrackingEnabled:YES];
803 [pauseButton_ setDefaultImage: 804 [pauseButton_ setDefaultImage:
804 rb.GetNativeImageNamed(IDR_NOTIFICATION_DO_NOT_DISTURB).ToNSImage()]; 805 rb.GetNativeImageNamed(IDR_NOTIFICATION_DO_NOT_DISTURB).ToNSImage()];
805 } 806 }
806 } 807 }
807 808
808 @end 809 @end
OLDNEW
« no previous file with comments | « ui/message_center/cocoa/popup_collection.mm ('k') | ui/message_center/fake_message_center.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698