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

Side by Side Diff: ui/arc/notification/arc_notification_surface_manager_impl.h

Issue 2935893004: Add unittest for ArcNotificationContentView (Closed)
Patch Set: Rebased Created 3 years, 6 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 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_ARC_NOTIFICATION_ARC_NOTIFICATION_SURFACE_MANAGER_IMPL_H_
6 #define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_SURFACE_MANAGER_IMPL_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "base/observer_list.h"
13 #include "components/exo/notification_surface_manager.h"
14 #include "ui/arc/notification/arc_notification_surface_manager.h"
15
16 namespace arc {
17
18 class ArcNotificationSurface;
19 class ArcNotificationSurfaceImpl;
20
21 class ArcNotificationSurfaceManagerImpl
22 : public ArcNotificationSurfaceManager,
23 public exo::NotificationSurfaceManager {
24 public:
25 ArcNotificationSurfaceManagerImpl();
26 ~ArcNotificationSurfaceManagerImpl() override;
27
28 // ArcNotificationSurfaceManager:
29 ArcNotificationSurface* GetArcSurface(
30 const std::string& notification_id) const override;
31 void AddObserver(Observer* observer) override;
32 void RemoveObserver(Observer* observer) override;
33
34 // exo::NotificationSurfaceManager:
35 exo::NotificationSurface* GetSurface(
36 const std::string& notification_id) const override;
37 void AddSurface(exo::NotificationSurface* surface) override;
38 void RemoveSurface(exo::NotificationSurface* surface) override;
39
40 private:
41 using NotificationSurfaceMap =
42 std::map<std::string, std::unique_ptr<ArcNotificationSurfaceImpl>>;
hidehiko 2017/06/15 15:26:21 nit: unordered_map sounds more efficient?
yoshiki 2017/06/16 11:29:09 Done.
43 NotificationSurfaceMap notification_surface_map_;
44
45 base::ObserverList<Observer> observers_;
46
47 DISALLOW_COPY_AND_ASSIGN(ArcNotificationSurfaceManagerImpl);
48 };
49
50 } // namespace arc
51
52 #endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_SURFACE_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698