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 base::scoped_nsobject<NotificationBuilder> builder( | 172 base::scoped_nsobject<NotificationBuilder> builder( |
| 173 [[NotificationBuilder alloc] | 173 [[NotificationBuilder alloc] |
| 174 initWithCloseLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_CLOSE) | 174 initWithCloseLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_CLOSE) |
| 175 optionsLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_MORE) | 175 optionsLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_MORE) |
| 176 settingsLabel:l10n_util::GetNSString( | 176 settingsLabel:l10n_util::GetNSString( |
| 177 IDS_NOTIFICATION_BUTTON_SETTINGS)]); | 177 IDS_NOTIFICATION_BUTTON_SETTINGS)]); |
| 178 | 178 |
| 179 [builder setTitle:base::SysUTF16ToNSString(notification.title())]; | 179 [builder setTitle:base::SysUTF16ToNSString(notification.title())]; |
| 180 [builder setContextMessage:base::SysUTF16ToNSString(notification.message())]; | 180 [builder setContextMessage:base::SysUTF16ToNSString(notification.message())]; |
| 181 | 181 |
| 182 bool requires_attribution = | |
| 183 notification.context_message().empty() && | |
| 184 notification_type != NotificationCommon::EXTENSION; | |
|
Peter Beverloo
2017/04/07 02:26:53
Just checking for "notification_type != EXTENSION"
Miguel Garcia
2017/04/07 13:32:06
mm no? We need the class prefix :)
| |
| 185 | |
| 182 base::string16 subtitle = | 186 base::string16 subtitle = |
| 183 notification.context_message().empty() | 187 requires_attribution |
| 184 ? url_formatter::FormatOriginForSecurityDisplay( | 188 ? url_formatter::FormatOriginForSecurityDisplay( |
| 185 url::Origin(notification.origin_url()), | 189 url::Origin(notification.origin_url()), |
| 186 url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS) | 190 url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS) |
| 187 : notification.context_message(); | 191 : notification.context_message(); |
| 188 | 192 |
| 189 [builder setSubTitle:base::SysUTF16ToNSString(subtitle)]; | 193 [builder setSubTitle:base::SysUTF16ToNSString(subtitle)]; |
| 190 if (!notification.icon().IsEmpty()) { | 194 if (!notification.icon().IsEmpty()) { |
| 191 [builder setIcon:notification.icon().ToNSImage()]; | 195 [builder setIcon:notification.icon().ToNSImage()]; |
| 192 } | 196 } |
| 193 | 197 |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 base::scoped_nsobject<CrXPCMachPort> xpcPort( | 570 base::scoped_nsobject<CrXPCMachPort> xpcPort( |
| 567 [[CrXPCMachPort alloc] initWithMachSendRight:std::move(exceptionPort)]); | 571 [[CrXPCMachPort alloc] initWithMachSendRight:std::move(exceptionPort)]); |
| 568 [proxy setMachExceptionPort:xpcPort]; | 572 [proxy setMachExceptionPort:xpcPort]; |
| 569 setExceptionPort_ = YES; | 573 setExceptionPort_ = YES; |
| 570 } | 574 } |
| 571 | 575 |
| 572 return proxy; | 576 return proxy; |
| 573 } | 577 } |
| 574 | 578 |
| 575 @end | 579 @end |
| OLD | NEW |