Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: ui/arc/notification/arc_notification_manager.cc

Issue 1603753003: Support buttons on ARC Notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..f0edafdb62d35a57bda6dc442cee5aa903f454fa 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -91,4 +91,29 @@ 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 is gone.";
hidehiko 2016/01/22 07:47:03 nit: maybe "it has gone"?
yoshiki 2016/01/25 15:45:50 Done.
+ return;
+ }
+
+ arc::ArcNotificationEvent command;
+ switch (button_index) {
+ case 0: command = ARC_NOTIFICATION_EVENT_BUTTON1_CLICKED; break;
hidehiko 2016/01/22 07:47:03 Let's follow the style guide: https://google.githu
yoshiki 2016/01/25 15:45:50 Done.
+ 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
« ui/arc/notification/arc_notification_item.h ('K') | « ui/arc/notification/arc_notification_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698