Commit 67b9d2c3 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Linux native notifications: Fix clickable buttons

On Peter's notification generator [1], creating a notification with
"Action" set to alert() and everyting else set to default settings,
notification->clickable() is false when I expected the notification to
be clickable.  This CL always makes notifications clickable regardless
of the clickable() state.

[1] https://tests.peter.sh/notification-generator/

BUG=676220
R=peter@chromium.org
CC=thestig@chromium.org

Change-Id: I326b6fa5b64e8a18aa95ea47dfbcbe5caaaa9bdc
Reviewed-on: https://chromium-review.googlesource.com/748213Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513159}
parent 9d3dff18
...@@ -622,12 +622,10 @@ class NotificationPlatformBridgeLinuxImpl ...@@ -622,12 +622,10 @@ class NotificationPlatformBridgeLinuxImpl
actions.push_back(id); actions.push_back(id);
actions.push_back(label); actions.push_back(label);
} }
if (notification->clickable()) { // Special case: the id "default" will not add a button, but
// Special case: the pair ("default", "") will not add a button, // instead makes the entire notification clickable.
// but instead makes the entire notification clickable. actions.push_back(kDefaultButtonId);
actions.push_back(kDefaultButtonId); actions.push_back("Activate");
actions.push_back("");
}
// Always add a settings button for web notifications. // Always add a settings button for web notifications.
if (notification_type != NotificationCommon::EXTENSION) { if (notification_type != NotificationCommon::EXTENSION) {
actions.push_back(kSettingsButtonId); actions.push_back(kSettingsButtonId);
......
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