Chromium Code Reviews| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 [NSUserNotificationCenter defaultUserNotificationCenter], nil); | 172 [NSUserNotificationCenter defaultUserNotificationCenter], nil); |
| 173 #endif // ENABLE_XPC_NOTIFICATIONS | 173 #endif // ENABLE_XPC_NOTIFICATIONS |
| 174 } | 174 } |
| 175 | 175 |
| 176 void NotificationPlatformBridgeMac::Display( | 176 void NotificationPlatformBridgeMac::Display( |
| 177 NotificationCommon::Type notification_type, | 177 NotificationCommon::Type notification_type, |
| 178 const std::string& notification_id, | 178 const std::string& notification_id, |
| 179 const std::string& profile_id, | 179 const std::string& profile_id, |
| 180 bool incognito, | 180 bool incognito, |
| 181 const Notification& notification) { | 181 const Notification& notification) { |
| 182 base::scoped_nsobject<NotificationBuilder> builder( | 182 base::scoped_nsobject<NotificationBuilder> builder([ |
|
Robert Sesek
2017/03/22 14:35:25
Silly clang-format?
Miguel Garcia
2017/03/22 20:45:57
Yes in fact I had to bypass it because it kept ins
Miguel Garcia
2017/03/22 20:45:58
Yes in fact I had to bypass it because it kept ins
| |
| 183 [[NotificationBuilder alloc] | 183 [NotificationBuilder alloc] |
| 184 initWithCloseLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_CLOSE) | 184 initWithCloseLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_CLOSE) |
| 185 optionsLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_OPTIONS) | 185 optionsLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_MORE) |
| 186 settingsLabel:l10n_util::GetNSString( | 186 settingsLabel:l10n_util::GetNSString( |
| 187 IDS_NOTIFICATION_BUTTON_SETTINGS)]); | 187 IDS_NOTIFICATION_BUTTON_SETTINGS)]); |
| 188 | 188 |
| 189 [builder setTitle:base::SysUTF16ToNSString(notification.title())]; | 189 [builder setTitle:base::SysUTF16ToNSString(notification.title())]; |
| 190 [builder setContextMessage:base::SysUTF16ToNSString(notification.message())]; | 190 [builder setContextMessage:base::SysUTF16ToNSString(notification.message())]; |
| 191 | 191 |
| 192 base::string16 subtitle = | 192 base::string16 subtitle = |
| 193 notification.context_message().empty() | 193 notification.context_message().empty() |
| 194 ? url_formatter::FormatOriginForSecurityDisplay( | 194 ? url_formatter::FormatOriginForSecurityDisplay( |
| 195 url::Origin(notification.origin_url()), | 195 url::Origin(notification.origin_url()), |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 525 base::scoped_nsobject<CrXPCMachPort> xpcPort( | 525 base::scoped_nsobject<CrXPCMachPort> xpcPort( |
| 526 [[CrXPCMachPort alloc] initWithMachSendRight:std::move(exceptionPort)]); | 526 [[CrXPCMachPort alloc] initWithMachSendRight:std::move(exceptionPort)]); |
| 527 [proxy setMachExceptionPort:xpcPort]; | 527 [proxy setMachExceptionPort:xpcPort]; |
| 528 setExceptionPort_ = YES; | 528 setExceptionPort_ = YES; |
| 529 } | 529 } |
| 530 | 530 |
| 531 return proxy; | 531 return proxy; |
| 532 } | 532 } |
| 533 | 533 |
| 534 @end | 534 @end |
| OLD | NEW |