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 #include "ui/arc/notification/arc_notification_manager.h" | 5 #include "ui/arc/notification/arc_notification_manager.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "ui/arc/notification/arc_notification_item.h" | 8 #include "ui/arc/notification/arc_notification_item.h" |
9 | 9 |
10 namespace arc { | 10 namespace arc { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 ItemMap::iterator it = items_.find(key); | 69 ItemMap::iterator it = items_.find(key); |
70 if (it == items_.end()) { | 70 if (it == items_.end()) { |
71 VLOG(3) << "Chrome requests to remove a notification (key: " << key | 71 VLOG(3) << "Chrome requests to remove a notification (key: " << key |
72 << "), but it is already gone."; | 72 << "), but it is already gone."; |
73 return; | 73 return; |
74 } | 74 } |
75 | 75 |
76 scoped_ptr<ArcNotificationItem> item(items_.take_and_erase(it)); | 76 scoped_ptr<ArcNotificationItem> item(items_.take_and_erase(it)); |
77 | 77 |
78 arc_bridge_->notifications_instance()->SendNotificationEventToAndroid( | 78 arc_bridge_->notifications_instance()->SendNotificationEventToAndroid( |
79 key, ARC_NOTIFICATION_EVENT_CLOSED); | 79 key, ArcNotificationEvent::CLOSED); |
80 } | 80 } |
81 | 81 |
82 void ArcNotificationManager::SendNotificationClickedOnChrome( | 82 void ArcNotificationManager::SendNotificationClickedOnChrome( |
83 const std::string& key) { | 83 const std::string& key) { |
84 if (!items_.contains(key)) { | 84 if (!items_.contains(key)) { |
85 VLOG(3) << "Chrome requests to fire a click event on notification (key: " | 85 VLOG(3) << "Chrome requests to fire a click event on notification (key: " |
86 << key << "), but it is gone."; | 86 << key << "), but it is gone."; |
87 return; | 87 return; |
88 } | 88 } |
89 | 89 |
90 arc_bridge_->notifications_instance()->SendNotificationEventToAndroid( | 90 arc_bridge_->notifications_instance()->SendNotificationEventToAndroid( |
91 key, ARC_NOTIFICATION_EVENT_BODY_CLICKED); | 91 key, ArcNotificationEvent::BODY_CLICKED); |
92 } | 92 } |
93 | 93 |
94 } // namespace arc | 94 } // namespace arc |
OLD | NEW |