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

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

Issue 1895473002: PlatformNotificationService layering cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@display_manager2
Patch Set: Created 4 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
Peter Beverloo 2016/04/25 13:37:29 2014??
Miguel Garcia 2016/04/25 17:19:59 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/notifications/stub_notification_platform_bridge.h"
6
7 StubNotificationPlatformBridge::StubNotificationPlatformBridge()
8 : NotificationPlatformBridge() {}
9
10 StubNotificationPlatformBridge::~StubNotificationPlatformBridge() {}
11
12 Notification StubNotificationPlatformBridge::GetNotificationAt(size_t index) {
13 DCHECK_GT(notifications_.size(), index);
14 return notifications_[index];
15 }
16
17 void StubNotificationPlatformBridge::Display(const std::string& notification_id,
18 const std::string& profile_id,
19 bool incognito,
20 const Notification& notification) {
21 notifications_.push_back(notification);
22 }
23
24 void StubNotificationPlatformBridge::Close(const std::string& profile_id,
25 const std::string& notification_id) {
26 for (auto iter = notifications_.begin(); iter != notifications_.end();
27 ++iter) {
28 if (iter->id() == notification_id) {
29 notifications_.erase(iter);
30 break;
31 }
32 }
Peter Beverloo 2016/04/25 13:37:29 This should probably care about the |profile_id|?
Miguel Garcia 2016/04/25 17:19:59 Moved to a map of vectors Happy to discuss if the
33 }
34
35 bool StubNotificationPlatformBridge::GetDisplayed(
36 const std::string& profile_id,
37 bool incognito,
38 std::set<std::string>* notifications) const {
39 for (auto notification : notifications_)
40 notifications->insert(notification.id());
41 return true;
42 }
43
44 bool StubNotificationPlatformBridge::SupportsNotificationCenter() const {
45 return false;
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698