Commit fd772338 authored by yoshiki iguchi's avatar yoshiki iguchi Committed by Commit Bot

Open message center after inline reply button is clocked on lock screen

This CL adds the code to open the message center after unlocking if user
clicks the inline reply button on the lock screen.

We also need to focus the target notification but let me leave it to the
separate CL.

Bug: b/79951342
Test: manual

Change-Id: I7d47e4064d0a85dc144d2895ae34c85789acf9d9
Reviewed-on: https://chromium-review.googlesource.com/c/1314022Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Commit-Queue: Yoshiki Iguchi <yoshiki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605253}
parent cbd4a0c4
......@@ -255,7 +255,7 @@ void ArcNotificationManager::OnLockScreenSettingUpdated(
void ArcNotificationManager::ProcessUserAction(
arc::mojom::ArcNotificationUserActionDataPtr data) {
if (!data->defer_until_unlock) {
PerformUserAction(data->action_id);
PerformUserAction(data->action_id, data->to_be_focused_after_unlock);
return;
}
......@@ -264,12 +264,14 @@ void ArcNotificationManager::ProcessUserAction(
->lock_screen_controller()
->DismissLockScreenThenExecute(
base::BindOnce(&ArcNotificationManager::PerformUserAction,
weak_ptr_factory_.GetWeakPtr(), data->action_id),
weak_ptr_factory_.GetWeakPtr(), data->action_id,
data->to_be_focused_after_unlock),
base::BindOnce(&ArcNotificationManager::CancelUserAction,
weak_ptr_factory_.GetWeakPtr(), data->action_id));
}
void ArcNotificationManager::PerformUserAction(uint32_t id) {
void ArcNotificationManager::PerformUserAction(uint32_t id,
bool open_message_center) {
// TODO(yoshiki): Pass the event to the message center and handle the action
// in the NotificationDelegate::Click() for consistency with non-arc
// notifications.
......@@ -285,8 +287,11 @@ void ArcNotificationManager::PerformUserAction(uint32_t id) {
notifications_instance->PerformDeferredUserAction(id);
// TODO(yoshiki): open the message center and focus the target notification if
// the flag is set.
if (open_message_center) {
OpenMessageCenter();
// TODO(yoshiki): focus the target notification after opening the message
// center.
}
}
void ArcNotificationManager::CancelUserAction(uint32_t id) {
......
......@@ -78,7 +78,7 @@ class ArcNotificationManager
bool ShouldIgnoreNotification(arc::mojom::ArcNotificationData* data);
void PerformUserAction(uint32_t id);
void PerformUserAction(uint32_t id, bool open_message_center);
void CancelUserAction(uint32_t id);
// Invoked when |get_app_id_callback_| gets back the app id.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment