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

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: Rebased and formatted Created 4 years, 12 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 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 : public ArcBridgeService::NotificationObserver {
20 public:
21 explicit ArcNotificationManager(ArcBridgeService* bridge_service,
22 const AccountId& main_profile_id);
23 ~ArcNotificationManager() override;
24
25 // ArcBridgeService::Observer implementation:
26 void OnNotificationPostedFromAndroid(
27 const ArcNotificationData& data) override;
28 void OnNotificationRemovedFromAndroid(const std::string& key) override;
29
30 // Methods called from ArcNotificationItem:
31 void SendNotificationRemovedFromChrome(const std::string& key);
32 void SendNotificationClickedOnChrome(const std::string& key);
33
34 private:
35 ArcBridgeService* const arc_bridge_;
36 const AccountId main_profile_id_;
37
38 typedef base::ScopedPtrHashMap<std::string, scoped_ptr<ArcNotificationItem>>
39 Items;
40 Items items_;
41
42 DISALLOW_COPY_AND_ASSIGN(ArcNotificationManager);
43 };
44
45 } // namespace arc
46
47 #endif // COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698