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

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

Issue 1477733002: Add ArcNotificationManager for new ARC notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved to ui/arc and Addressed comments Created 4 years, 11 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 2016 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_MANAGER_H_
6 #define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/containers/scoped_ptr_hash_map.h"
12 #include "components/arc/arc_bridge_service.h"
13 #include "components/arc/common/notifications.mojom.h"
14 #include "components/signin/core/account_id/account_id.h"
15 #include "mojo/public/cpp/bindings/binding.h"
16
17 namespace arc {
18
19 class ArcNotificationItem;
20
21 class ArcNotificationManager : public ArcBridgeService::Observer,
22 public NotificationsHost {
23 public:
24 explicit ArcNotificationManager(ArcBridgeService* bridge_service,
hidehiko 2016/01/05 11:41:33 nit: no explicit.
yoshiki 2016/01/06 08:50:17 Done.
25 const AccountId& main_profile_id);
26 ~ArcNotificationManager() override;
27
28 // ArcBridgeService::Observer implementation:
29 // void OnStateChanged(ArcBridgeService::State state) override;
hidehiko 2016/01/05 11:41:33 nit: Remove this line?
yoshiki 2016/01/06 08:50:17 Done.
30 void OnNotificationsInstanceReady() override;
31
32 // NotificationsHost implementation:
33 void OnNotificationPosted(ArcNotificationDataPtr data) override;
34 void OnNotificationRemoved(const mojo::String& key) override;
35
36 // Methods called from ArcNotificationItem:
37 void SendNotificationRemovedFromChrome(const std::string& key);
38 void SendNotificationClickedOnChrome(const std::string& key);
39
40 private:
41 ArcBridgeService* const arc_bridge_;
42 const AccountId main_profile_id_;
43
44 typedef base::ScopedPtrHashMap<std::string, scoped_ptr<ArcNotificationItem>>
45 Items;
stevenjb 2016/01/05 16:59:06 nit: ItemMap would be more clear.
yoshiki 2016/01/06 08:50:17 Done.
46 Items items_;
47
48 mojo::Binding<arc::NotificationsHost> binding_;
49
50 DISALLOW_COPY_AND_ASSIGN(ArcNotificationManager);
51 };
52
53 } // namespace arc
54
55 #endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698