OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "chrome/browser/notifications/notification_platform_bridge_mac.h" | 5 #include "chrome/browser/notifications/notification_platform_bridge_mac.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 const std::string& profile_id, | 313 const std::string& profile_id, |
314 bool incognito, | 314 bool incognito, |
315 const GetDisplayedNotificationsCallback& callback) const { | 315 const GetDisplayedNotificationsCallback& callback) const { |
316 [alert_dispatcher_ | 316 [alert_dispatcher_ |
317 getDisplayedAlertsForProfileId:base::SysUTF8ToNSString(profile_id) | 317 getDisplayedAlertsForProfileId:base::SysUTF8ToNSString(profile_id) |
318 incognito:incognito | 318 incognito:incognito |
319 notificationCenter:notification_center_ | 319 notificationCenter:notification_center_ |
320 callback:callback]; | 320 callback:callback]; |
321 } | 321 } |
322 | 322 |
| 323 void NotificationPlatformBridgeMac::SetReadyCallback( |
| 324 NotificationBridgeReadyCallback callback) { |
| 325 std::move(callback).Run(true); |
| 326 } |
| 327 |
323 // static | 328 // static |
324 void NotificationPlatformBridgeMac::ProcessNotificationResponse( | 329 void NotificationPlatformBridgeMac::ProcessNotificationResponse( |
325 NSDictionary* response) { | 330 NSDictionary* response) { |
326 if (!NotificationPlatformBridgeMac::VerifyNotificationData(response)) | 331 if (!NotificationPlatformBridgeMac::VerifyNotificationData(response)) |
327 return; | 332 return; |
328 | 333 |
329 NSNumber* button_index = | 334 NSNumber* button_index = |
330 [response objectForKey:notification_constants::kNotificationButtonIndex]; | 335 [response objectForKey:notification_constants::kNotificationButtonIndex]; |
331 NSNumber* operation = | 336 NSNumber* operation = |
332 [response objectForKey:notification_constants::kNotificationOperation]; | 337 [response objectForKey:notification_constants::kNotificationOperation]; |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 base::scoped_nsobject<CrXPCMachPort> xpcPort( | 576 base::scoped_nsobject<CrXPCMachPort> xpcPort( |
572 [[CrXPCMachPort alloc] initWithMachSendRight:std::move(exceptionPort)]); | 577 [[CrXPCMachPort alloc] initWithMachSendRight:std::move(exceptionPort)]); |
573 [proxy setMachExceptionPort:xpcPort]; | 578 [proxy setMachExceptionPort:xpcPort]; |
574 setExceptionPort_ = YES; | 579 setExceptionPort_ = YES; |
575 } | 580 } |
576 | 581 |
577 return proxy; | 582 return proxy; |
578 } | 583 } |
579 | 584 |
580 @end | 585 @end |
OLD | NEW |