| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |