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

Side by Side Diff: chrome/browser/notifications/stub_notification_display_service.cc

Issue 2813943002: Drop the const modifier on NotificationDisplayService::GetDisplayed (Closed)
Patch Set: sync and 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 | « chrome/browser/notifications/stub_notification_display_service.h ('k') | 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/stub_notification_display_service.h" 5 #include "chrome/browser/notifications/stub_notification_display_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 std::remove_if( 71 std::remove_if(
72 notifications_.begin(), notifications_.end(), 72 notifications_.begin(), notifications_.end(),
73 [notification_type, notification_id](const NotificationData& data) { 73 [notification_type, notification_id](const NotificationData& data) {
74 return data.first == notification_type && 74 return data.first == notification_type &&
75 data.second.delegate_id() == notification_id; 75 data.second.delegate_id() == notification_id;
76 }), 76 }),
77 notifications_.end()); 77 notifications_.end());
78 } 78 }
79 79
80 void StubNotificationDisplayService::GetDisplayed( 80 void StubNotificationDisplayService::GetDisplayed(
81 const DisplayedNotificationsCallback& callback) const { 81 const DisplayedNotificationsCallback& callback) {
82 std::unique_ptr<std::set<std::string>> notifications = 82 std::unique_ptr<std::set<std::string>> notifications =
83 base::MakeUnique<std::set<std::string>>(); 83 base::MakeUnique<std::set<std::string>>();
84 84
85 for (const auto& notification_data : notifications_) 85 for (const auto& notification_data : notifications_)
86 notifications->insert(notification_data.second.delegate_id()); 86 notifications->insert(notification_data.second.delegate_id());
87 87
88 callback.Run(std::move(notifications), true /* supports_synchronization */); 88 callback.Run(std::move(notifications), true /* supports_synchronization */);
89 } 89 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/stub_notification_display_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698