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

Side by Side Diff: chrome/browser/notifications/notification_platform_bridge_mac.mm

Issue 2822453002: Display the first item for list mac native notifications (Closed)
Patch Set: rebase Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 base::scoped_nsobject<NotificationBuilder> builder( 176 base::scoped_nsobject<NotificationBuilder> builder(
177 [[NotificationBuilder alloc] 177 [[NotificationBuilder alloc]
178 initWithCloseLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_CLOSE) 178 initWithCloseLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_CLOSE)
179 optionsLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_MORE) 179 optionsLabel:l10n_util::GetNSString(IDS_NOTIFICATION_BUTTON_MORE)
180 settingsLabel:l10n_util::GetNSString( 180 settingsLabel:l10n_util::GetNSString(
181 IDS_NOTIFICATION_BUTTON_SETTINGS)]); 181 IDS_NOTIFICATION_BUTTON_SETTINGS)]);
182 182
183 [builder 183 [builder
184 setTitle:base::SysUTF16ToNSString(CreateNotificationTitle(notification))]; 184 setTitle:base::SysUTF16ToNSString(CreateNotificationTitle(notification))];
185 185
186 [builder setContextMessage:base::SysUTF16ToNSString(notification.message())]; 186 base::string16 context_message =
187 notification.items().empty()
188 ? notification.message()
189 : (notification.items().at(0).title + base::UTF8ToUTF16(" - ") +
190 notification.items().at(0).message);
191
192 [builder setContextMessage:base::SysUTF16ToNSString(context_message)];
187 193
188 bool requires_attribution = 194 bool requires_attribution =
189 notification.context_message().empty() && 195 notification.context_message().empty() &&
190 notification_type != NotificationCommon::EXTENSION; 196 notification_type != NotificationCommon::EXTENSION;
191 197
192 base::string16 subtitle = 198 base::string16 subtitle =
193 requires_attribution 199 requires_attribution
194 ? url_formatter::FormatOriginForSecurityDisplay( 200 ? url_formatter::FormatOriginForSecurityDisplay(
195 url::Origin(notification.origin_url()), 201 url::Origin(notification.origin_url()),
196 url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS) 202 url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS)
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 base::scoped_nsobject<CrXPCMachPort> xpcPort( 555 base::scoped_nsobject<CrXPCMachPort> xpcPort(
550 [[CrXPCMachPort alloc] initWithMachSendRight:std::move(exceptionPort)]); 556 [[CrXPCMachPort alloc] initWithMachSendRight:std::move(exceptionPort)]);
551 [proxy setMachExceptionPort:xpcPort]; 557 [proxy setMachExceptionPort:xpcPort];
552 setExceptionPort_ = YES; 558 setExceptionPort_ = YES;
553 } 559 }
554 560
555 return proxy; 561 return proxy;
556 } 562 }
557 563
558 @end 564 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698