OLD | NEW |
(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_ |
OLD | NEW |