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

Unified Diff: chrome/browser/notifications/stub_notification_platform_bridge.h

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/stub_notification_platform_bridge.h
diff --git a/chrome/browser/notifications/stub_notification_platform_bridge.h b/chrome/browser/notifications/stub_notification_platform_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..59bd8b03f559a4316d7a8d05e9051ef2790248df
--- /dev/null
+++ b/chrome/browser/notifications/stub_notification_platform_bridge.h
@@ -0,0 +1,42 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NOTIFICATIONS_STUB_NOTIFICATION_PLATFORM_BRIDGE_H_
+#define CHROME_BROWSER_NOTIFICATIONS_STUB_NOTIFICATION_PLATFORM_BRIDGE_H_
+
+#include <map>
+#include <vector>
+
+#include "base/macros.h"
+#include "chrome/browser/notifications/notification.h"
+#include "chrome/browser/notifications/notification_platform_bridge.h"
+
+// Implementation of NotificationPlatformBridge used for tests.
+class StubNotificationPlatformBridge : public NotificationPlatformBridge {
+ public:
+ StubNotificationPlatformBridge();
+ ~StubNotificationPlatformBridge() override;
+
+ // Returns the notification being displayed at position |index|.
+ Notification GetNotificationAt(std::string profile_id, size_t index);
+
+ // NotificationPlatformBridge implementation.
+ void Display(const std::string& notification_id,
+ const std::string& profile_id,
+ bool incognito,
+ const Notification& notification) override;
+ void Close(const std::string& profile_id,
+ const std::string& notification_id) override;
+ bool GetDisplayed(const std::string& profile_id,
+ bool incognito,
+ std::set<std::string>* notifications) const override;
+ bool SupportsNotificationCenter() const override;
+
+ private:
+ // ProfileId -> Notification list
Peter Beverloo 2016/04/25 17:40:31 // Map of profile Ids to list of notifications sho
Miguel Garcia 2016/04/25 18:46:08 Done.
+ std::map<std::string, std::vector<Notification>> notifications_;
Peter Beverloo 2016/04/25 17:40:31 nit: std::unordered_map
Miguel Garcia 2016/04/25 18:45:33 Done.
+ DISALLOW_COPY_AND_ASSIGN(StubNotificationPlatformBridge);
+};
+
+#endif // CHROME_BROWSER_NOTIFICATIONS_STUB_NOTIFICATION_PLATFORM_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698