Improve clarity of Physical Web opt-in notification
The previous notification message did not communicate what the Physical Web
is or why users should turn it on. Additionally, there was little
indication that the notification came from Chrome and not a separate app.
This change updates the notification text and icon to soften the
introduction.
BUG=583541
NOTRY=true
NOPRESUBMIT=true
(cherry picked from commit 02432cab3b500ba797b9ecfc67e10d0e1ce9be8f)
Original review URL: https://codereview.chromium.org/1664673003/ .
Review URL: https://codereview.chromium.org/1709353002
Cr-Commit-Position: refs/branch-heads/2623@{#444}
Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java
index 07b4dc2..0d318af 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java
@@ -342,14 +342,15 @@
// Get values to display.
Resources resources = mContext.getResources();
String title = resources.getString(R.string.physical_web_optin_notification_title);
- Bitmap largeIcon = BitmapFactory.decodeResource(resources,
- R.drawable.physical_web_notification_large);
+ String text = resources.getString(R.string.physical_web_optin_notification_text);
+ Bitmap largeIcon = BitmapFactory.decodeResource(resources, R.mipmap.app_icon);
// Create the notification.
Notification notification = new NotificationCompat.Builder(mContext)
.setLargeIcon(largeIcon)
- .setSmallIcon(R.drawable.ic_chrome)
+ .setSmallIcon(R.drawable.ic_physical_web_notification)
.setContentTitle(title)
+ .setContentText(text)
.setContentIntent(pendingIntent)
.setPriority(priority)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
index 0b6a40a..887817a 100644
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -2346,7 +2346,7 @@
Chrome will scan for nearby pages when your device is unlocked. These pages will go through a Google service to improve the quality of page results.
-You can control Physical Web settings in Chrome privacy settings.
+You can control the Physical Web in Chrome privacy settings.
</message>
<message name="IDS_PHYSICAL_WEB_LIST_URLS_ACTIVITY_TITLE" desc="The title for a dialog that shows a list of URLs broadcasted from nearby devices.">
The Physical Web
@@ -2354,8 +2354,11 @@
<message name="IDS_PHYSICAL_WEB_NOTIFICATION_TITLE" desc="The message displayed in a notification when there are nearby URLs.">
Physical Web pages nearby
</message>
- <message name="IDS_PHYSICAL_WEB_OPTIN_NOTIFICATION_TITLE" desc="A notification message inviting the user to opt-in to the Physical Web.">
- Turn on the Physical Web?
+ <message name="IDS_PHYSICAL_WEB_OPTIN_NOTIFICATION_TITLE" desc="The first line in a notification message informing the user there are nearby devices broadcasting URLs and Chrome can be used to browse the list of URLs.">
+ Physical Web pages are nearby
+ </message>
+ <message name="IDS_PHYSICAL_WEB_OPTIN_NOTIFICATION_TEXT" desc="The second line in a notification message informing the user there are nearby devices broadcasting URLs and Chrome can be used to browse the list of URLs.">
+ Use Chrome to browse them
</message>
<message name="IDS_PHYSICAL_WEB_EMPTY_LIST" desc="The message displayed in place of a list of nearby URLs when there are no URLs to display.">
No nearby Physical Web pages found