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

Side by Side Diff: components/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: Addressed comments Created 5 years 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 2015 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 COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_
6 #define COMPONENTS_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/signin/core/account_id/account_id.h"
14
15 namespace arc {
16
17 class ArcNotificationItem;
18
19 class ArcNotificationManager
20 : public ArcBridgeService::NotificationObserver {
21 public:
22 explicit ArcNotificationManager(ArcBridgeService* bridge_service,
23 const AccountId& main_profile_id);
24 ~ArcNotificationManager() override;
25
26 // ArcBridgeService::Observer implementation:
27 void OnNotificationPostedFromAndroid(
28 const ArcNotificationData& data) override;
29 void OnNotificationRemovedFromAndroid(const std::string& key) override;
30
31 // Methods called from ArcNotificationItem:
32 void SendNotificationRemovedFromChrome(const std::string& key);
33 void SendNotificationClickedOnChrome(const std::string& key);
34
35 private:
36 ArcBridgeService* const arc_bridge_;
37 const AccountId main_profile_id_;
38
39 typedef base::ScopedPtrHashMap<std::string, scoped_ptr<ArcNotificationItem>>
40 Items;
41 Items items_;
42
43 DISALLOW_COPY_AND_ASSIGN(ArcNotificationManager);
44 };
45
46 } // namespace arc
47
48 #endif // COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698