| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_ | 5 #ifndef UI_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_ |
| 6 #define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_ | 6 #define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 message_center::MessageCenter* message_center); | 34 message_center::MessageCenter* message_center); |
| 35 | 35 |
| 36 ~ArcNotificationManager() override; | 36 ~ArcNotificationManager() override; |
| 37 | 37 |
| 38 // InstanceHolder<mojom::NotificationsInstance>::Observer implementation: | 38 // InstanceHolder<mojom::NotificationsInstance>::Observer implementation: |
| 39 void OnInstanceReady() override; | 39 void OnInstanceReady() override; |
| 40 void OnInstanceClosed() override; | 40 void OnInstanceClosed() override; |
| 41 | 41 |
| 42 // mojom::NotificationsHost implementation: | 42 // mojom::NotificationsHost implementation: |
| 43 void OnNotificationPosted(mojom::ArcNotificationDataPtr data) override; | 43 void OnNotificationPosted(mojom::ArcNotificationDataPtr data) override; |
| 44 void OnNotificationRemoved(const mojo::String& key) override; | 44 void OnNotificationRemoved(const std::string& key) override; |
| 45 void OnToastPosted(mojom::ArcToastDataPtr data) override; | 45 void OnToastPosted(mojom::ArcToastDataPtr data) override; |
| 46 void OnToastCancelled(mojom::ArcToastDataPtr data) override; | 46 void OnToastCancelled(mojom::ArcToastDataPtr data) override; |
| 47 | 47 |
| 48 // Methods called from ArcNotificationItem: | 48 // Methods called from ArcNotificationItem: |
| 49 void SendNotificationRemovedFromChrome(const std::string& key); | 49 void SendNotificationRemovedFromChrome(const std::string& key); |
| 50 void SendNotificationClickedOnChrome(const std::string& key); | 50 void SendNotificationClickedOnChrome(const std::string& key); |
| 51 void SendNotificationButtonClickedOnChrome(const std::string& key, | 51 void SendNotificationButtonClickedOnChrome(const std::string& key, |
| 52 int button_index); | 52 int button_index); |
| 53 void CreateNotificationWindow(const std::string& key); | 53 void CreateNotificationWindow(const std::string& key); |
| 54 void CloseNotificationWindow(const std::string& key); | 54 void CloseNotificationWindow(const std::string& key); |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 const AccountId main_profile_id_; | 57 const AccountId main_profile_id_; |
| 58 message_center::MessageCenter* const message_center_; | 58 message_center::MessageCenter* const message_center_; |
| 59 | 59 |
| 60 using ItemMap = | 60 using ItemMap = |
| 61 std::unordered_map<std::string, std::unique_ptr<ArcNotificationItem>>; | 61 std::unordered_map<std::string, std::unique_ptr<ArcNotificationItem>>; |
| 62 ItemMap items_; | 62 ItemMap items_; |
| 63 | 63 |
| 64 bool ready_ = false; | 64 bool ready_ = false; |
| 65 | 65 |
| 66 mojo::Binding<mojom::NotificationsHost> binding_; | 66 mojo::Binding<mojom::NotificationsHost> binding_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(ArcNotificationManager); | 68 DISALLOW_COPY_AND_ASSIGN(ArcNotificationManager); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace arc | 71 } // namespace arc |
| 72 | 72 |
| 73 #endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_ | 73 #endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_MANAGER_H_ |
| OLD | NEW |