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

Unified Diff: ui/arc/notification/arc_notification_surface_manager.h

Issue 2723143002: Add unittests of ArcCustomNotificationView (Closed)
Patch Set: wip Created 3 years, 7 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: ui/arc/notification/arc_notification_surface_manager.h
diff --git a/ui/arc/notification/arc_notification_surface_manager.h b/ui/arc/notification/arc_notification_surface_manager.h
index 4a5d6f503b59dd923d9ee82d61c4215ccb6256f9..4bef0f82cc1d5c6425b639fd8e8353048d78c30e 100644
--- a/ui/arc/notification/arc_notification_surface_manager.h
+++ b/ui/arc/notification/arc_notification_surface_manager.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_ARC_NOTIFICATION_ARC_NOTIFICATION_SURFACE_MANAGER_
-#define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_SURFACE_MANAGER_
+#ifndef UI_ARC_NOTIFICATION_ARC_NOTIFICATION_SURFACE_MANAGER_H_
+#define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_SURFACE_MANAGER_H_
#include <map>
#include <string>
@@ -14,47 +14,42 @@
namespace arc {
+class ArcNotificationSurface;
+
// Keeps track of NotificationSurface.
-class ArcNotificationSurfaceManager : public exo::NotificationSurfaceManager {
+class ArcNotificationSurfaceManager {
public:
class Observer {
public:
// Invoked when a notification surface is added to the registry.
virtual void OnNotificationSurfaceAdded(
- exo::NotificationSurface* surface) = 0;
+ ArcNotificationSurface* surface) = 0;
// Invoked when a notification surface is removed from the registry.
virtual void OnNotificationSurfaceRemoved(
- exo::NotificationSurface* surface) = 0;
+ ArcNotificationSurface* surface) = 0;
protected:
virtual ~Observer() = default;
};
ArcNotificationSurfaceManager();
- ~ArcNotificationSurfaceManager() override;
+ ~ArcNotificationSurfaceManager();
static ArcNotificationSurfaceManager* Get();
- // exo::NotificationSurfaceManager:
- exo::NotificationSurface* GetSurface(
- const std::string& notification_id) const override;
- void AddSurface(exo::NotificationSurface* surface) override;
- void RemoveSurface(exo::NotificationSurface* surface) override;
+ virtual ArcNotificationSurface* GetArcSurface(
+ const std::string& notification_id) const = 0;
- void AddObserver(Observer* observer);
- void RemoveObserver(Observer* observer);
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
private:
- using NotificationSurfaceMap =
- std::map<std::string, exo::NotificationSurface*>;
- NotificationSurfaceMap notification_surface_map_;
-
- base::ObserverList<Observer> observers_;
+ static ArcNotificationSurfaceManager* instance_;
DISALLOW_COPY_AND_ASSIGN(ArcNotificationSurfaceManager);
};
} // namespace arc
-#endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_SURFACE_MANAGER_
+#endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_SURFACE_MANAGER_H_
« no previous file with comments | « ui/arc/notification/arc_notification_surface_impl.cc ('k') | ui/arc/notification/arc_notification_surface_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698