Chromium Code Reviews| 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/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, | |
|
dcheng
2015/12/30 19:19:35
Nit: no explicit
yoshiki
2016/01/05 10:12:14
Done.
| |
| 25 const AccountId& main_profile_id); | |
| 26 ~ArcNotificationManager() override; | |
| 27 | |
| 28 // ArcBridgeService::Observer implementation: | |
| 29 // void OnStateChanged(ArcBridgeService::State state) override; | |
| 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; | |
| 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 // COMPONENTS_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_ | |
| OLD | NEW |