Commit 59cd12c4 authored by yoshiki iguchi's avatar yoshiki iguchi Committed by Commit Bot

Disable swipe and buttons when inline setting is visible

Previously, only the snooze setting hides the buttons and disables swipe.
This CL makes the inline setting do so. This is consistent with Android.

Bug: b/110329209
Test: manual (check the buttons are invisible and swipe is prohibited).

Change-Id: Ie177b445653eb74c9c01816fa0a09991875419dd
Reviewed-on: https://chromium-review.googlesource.com/1102437Reviewed-by: default avatarEliot Courtney <edcourtney@chromium.org>
Commit-Queue: Yoshiki Iguchi <yoshiki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568022}
parent ea924baf
......@@ -75,21 +75,23 @@ void ArcNotificationItemImpl::OnUpdatedFromAndroid(
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK_EQ(notification_key_, data->key);
bool is_snooze_setting_shown =
(data->shown_contents ==
arc::mojom::ArcNotificationShownContents::SNOOZE_SHOWN);
bool is_setting_shown =
((data->shown_contents ==
arc::mojom::ArcNotificationShownContents::SETTINGS_SHOWN) ||
(data->shown_contents ==
arc::mojom::ArcNotificationShownContents::SNOOZE_SHOWN));
message_center::RichNotificationData rich_data;
rich_data.pinned =
(data->no_clear || data->ongoing_event) // Unclosable notification
|| is_snooze_setting_shown; // Snooze setting is unclosable
|| is_setting_shown; // Settings are unclosable
rich_data.priority = ConvertAndroidPriority(data->priority);
if (data->small_icon)
rich_data.small_image = gfx::Image::CreateFrom1xBitmap(*data->small_icon);
rich_data.accessible_name = base::UTF8ToUTF16(
data->accessible_name.value_or(data->title + "\n" + data->message));
if (manager_->IsOpeningSettingsSupported() && !is_snooze_setting_shown) {
if (manager_->IsOpeningSettingsSupported() && !is_setting_shown) {
rich_data.settings_button_handler =
message_center::SettingsButtonHandler::DELEGATE;
} else {
......@@ -101,7 +103,7 @@ void ArcNotificationItemImpl::OnUpdatedFromAndroid(
(data->flags && (data->flags->value &
arc::mojom::ArcNotificationFlags::SUPPORT_SNOOZE) != 0);
rich_data.should_show_snooze_button =
is_snooze_supported && !is_snooze_setting_shown;
is_snooze_supported && !is_setting_shown;
message_center::NotifierId notifier_id(
message_center::NotifierId::ARC_APPLICATION,
......
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