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

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

Issue 2767253005: Implement TOGGLE_EXPANSION action for the ARC notifications. (Closed)
Patch Set: rebase Created 3 years, 9 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
« no previous file with comments | « ui/arc/notification/arc_notification_manager.h ('k') | ui/message_center/views/custom_notification_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ec72381cf210ba331dc3b48673a39b7b7b413797..5d421c33f85d3546a64fd4295ef1863bd4e91f5a 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -246,6 +246,28 @@ bool ArcNotificationManager::IsOpeningSettingsSupported() const {
return notifications_instance != nullptr;
}
+void ArcNotificationManager::SendNotificationToggleExpansionOnChrome(
+ const std::string& key) {
+ if (items_.find(key) == items_.end()) {
+ VLOG(3) << "Chrome requests to fire a click event on notification (key: "
+ << key << "), but it is gone.";
+ return;
+ }
+
+ auto* notifications_instance = ARC_GET_INSTANCE_FOR_METHOD(
+ arc_bridge_service()->notifications(), SendNotificationEventToAndroid);
+
+ // On shutdown, the ARC channel may quit earlier than notifications.
+ if (!notifications_instance) {
+ VLOG(2) << "ARC Notification (key: " << key
+ << ") is clicked, but the ARC channel has already gone.";
+ return;
+ }
+
+ notifications_instance->SendNotificationEventToAndroid(
+ key, mojom::ArcNotificationEvent::TOGGLE_EXPANSION);
+}
+
void ArcNotificationManager::OnToastPosted(mojom::ArcToastDataPtr data) {
const base::string16 text16(
base::UTF8ToUTF16(data->text.has_value() ? *data->text : std::string()));
« no previous file with comments | « ui/arc/notification/arc_notification_manager.h ('k') | ui/message_center/views/custom_notification_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698