Improve formatting of notifier URLs in notification settings |
||
Issue descriptionCurrently we are showing verbose URLs as web notifier source texts. (e.g. https://example.com:443) We can use safe formatter here. https://cs.chromium.org/chromium/src/chrome/browser/notifications/web_page_notifier_source.cc formatter: https://cs.chromium.org/chromium/src/components/url_formatter/url_formatter.h
,
Sep 28 2017
In this case, each items are not GURL but ContentSettingsPattern (which may include wildcard), so I found we cannot use url_formatter directly. In this line it passes ContentsSettingsPattern.ToString() to GURL(), which is failing on an item with wildcard. We may also have to fix that. https://cs.chromium.org/chromium/src/chrome/browser/notifications/web_page_notifier_source.cc?l=43&rcl=06f1401e7bd52b5c597f40bf22c67c58c66cf48e > BTW, where do we decide on how to render the context message (or origin URL) for the MD style notifications? it uses |display_source|. https://cs.chromium.org/chromium/src/ui/message_center/views/notification_view_md.cc?l=533&rcl=3b950aeae28ec523a6296ea39c1cb3e746d0f061 It comes from here, so it's GURL::host(). https://cs.chromium.org/chromium/src/chrome/browser/notifications/platform_notification_service_impl.cc?l=449&rcl=06f1401e7bd52b5c597f40bf22c67c58c66cf48e It seems we should change this to FormatUrlForSecurityDisplay too?
,
Sep 28 2017
Right - the URL included in |display_source| indicates the pattern because of which permission has been granted, not where the notification comes from. To give an example, a pattern might be "https://*:*", meaning that any https site can display notifications. It wouldn't be useful for the notification to display that. Because of that Notifications can have an origin, which is available through Notification::origin_url(): https://cs.chromium.org/chromium/src/ui/message_center/notification.h?q=notification.h+f:mess&sq=package:chromium&dr=CSs&l=254 That should be used instead of the |display_source| when available. On a tangent, do we still display context messages? If we don't, that's deprecation and we need to go through the right processes for that. (Which we already did for Mac.)
,
Sep 28 2017
We still use Notification::display_source for context titles such as "Download manager" so I don't think we can completely remove the attribute.
,
Oct 22
|
||
►
Sign in to add a comment |
||
Comment 1 by peter@chromium.org
, Sep 28 2017