Chromium Code Reviews| Index: ui/arc/notification/arc_notification_manager.cc |
| diff --git a/ui/arc/notification/arc_notification_manager.cc b/ui/arc/notification/arc_notification_manager.cc |
| index 91b8c269b2517fc2bced797f96c0d924b6744f94..5fba0213c82360fd676561878d00e6adf7420023 100644 |
| --- a/ui/arc/notification/arc_notification_manager.cc |
| +++ b/ui/arc/notification/arc_notification_manager.cc |
| @@ -56,7 +56,7 @@ void ArcNotificationManager::OnNotificationRemoved(const mojo::String& key) { |
| ItemMap::iterator it = items_.find(key.get()); |
| if (it == items_.end()) { |
| VLOG(3) << "Android requests to remove a notification (key: " << key |
| - << "), but it is already gone."; |
| + << "), but it has already gone."; |
|
dcheng
2016/01/26 08:42:08
Nit: "it is" here and elsewhere is probably more i
|
| return; |
| } |
| @@ -69,7 +69,7 @@ void ArcNotificationManager::SendNotificationRemovedFromChrome( |
| ItemMap::iterator it = items_.find(key); |
| if (it == items_.end()) { |
| VLOG(3) << "Chrome requests to remove a notification (key: " << key |
| - << "), but it is already gone."; |
| + << "), but it has already gone."; |
| return; |
| } |
| @@ -83,7 +83,7 @@ void ArcNotificationManager::SendNotificationClickedOnChrome( |
| const std::string& key) { |
| if (!items_.contains(key)) { |
| VLOG(3) << "Chrome requests to fire a click event on notification (key: " |
| - << key << "), but it is gone."; |
| + << key << "), but it has gone."; |
| return; |
| } |
| @@ -91,4 +91,39 @@ void ArcNotificationManager::SendNotificationClickedOnChrome( |
| key, ARC_NOTIFICATION_EVENT_BODY_CLICKED); |
| } |
| +void ArcNotificationManager::SendNotificationButtonClickedOnChrome( |
| + const std::string& key, int button_index) { |
| + if (!items_.contains(key)) { |
| + VLOG(3) << "Chrome requests to fire a click event on notification (key: " |
| + << key << "), but it has gone."; |
| + return; |
| + } |
| + |
| + arc::ArcNotificationEvent command; |
| + switch (button_index) { |
| + case 0: |
| + command = ARC_NOTIFICATION_EVENT_BUTTON1_CLICKED; |
| + break; |
| + case 1: |
| + command = ARC_NOTIFICATION_EVENT_BUTTON2_CLICKED; |
| + break; |
| + case 2: |
| + command = ARC_NOTIFICATION_EVENT_BUTTON3_CLICKED; |
| + break; |
| + case 3: |
| + command = ARC_NOTIFICATION_EVENT_BUTTON4_CLICKED; |
| + break; |
| + case 4: |
| + command = ARC_NOTIFICATION_EVENT_BUTTON5_CLICKED; |
| + break; |
| + default: |
| + VLOG(3) << "Invalid button index (key: " << key << ", index: " << |
| + button_index << ")."; |
| + return; |
| + } |
| + |
| + arc_bridge_->notifications_instance()->SendNotificationEventToAndroid( |
| + key, command); |
| +} |
| + |
| } // namespace arc |