Commit 6eb7fb46 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Add material design icon to locale change notification.

This CL adds new material design icon to locale change notification.
This CL also adds the notification title and shortens the message
based on UX review (https://crbug.com/726241#c20).

The icon and the accent color is effective only when
chrome://flags/#enable-message-center-new-style-notification
is Enabled (which is ToT default).

TEST=manual
BUG=726241

Change-Id: I16ac609c9f453064e27441c149ef2e4bcfa08d31
Reviewed-on: https://chromium-review.googlesource.com/662917Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501514}
parent 5259eec2
......@@ -319,8 +319,11 @@ This file contains the strings for ash.
Voice input
</message>
<message name="IDS_ASH_STATUS_TRAY_LOCALE_CHANGE_TITLE" desc="The title used for locale change notifications in the system tray.">
Language has been changed
</message>
<message name="IDS_ASH_STATUS_TRAY_LOCALE_CHANGE_MESSAGE" desc="The message used for locale change notifications in the system tray.">
The language has changed from "<ph name="FROM_LOCALE">$1<ex>Italian</ex></ph>" to "<ph name="TO_LOCALE">$2<ex>English (United States)</ex></ph>" after syncing your settings.
From "<ph name="FROM_LOCALE">$1<ex>Italian</ex></ph>" to "<ph name="TO_LOCALE">$2<ex>English (United States)</ex></ph>" after syncing your settings.
</message>
<message name="IDS_ASH_STATUS_TRAY_LOCALE_REVERT_MESSAGE" desc="Link to revert a change.">
Change back to "<ph name="FROM_LOCALE">$1<ex>Italian</ex></ph>" (requires restart)
......
......@@ -8,6 +8,7 @@
#include <utility>
#include "ash/resources/grit/ash_resources.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/system/system_notifier.h"
#include "ash/system/tray/system_tray_notifier.h"
......@@ -110,16 +111,20 @@ void LocaleNotificationController::OnLocaleChanged(
optional.never_timeout = true;
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
std::unique_ptr<Notification> notification(new Notification(
message_center::NOTIFICATION_TYPE_SIMPLE, kLocaleChangeNotificationId,
base::string16() /* title */,
l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_LOCALE_CHANGE_MESSAGE,
from, to),
bundle.GetImageNamed(IDR_AURA_UBER_TRAY_LOCALE),
base::string16() /* display_source */, GURL(),
message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
system_notifier::kNotifierLocale),
optional, new LocaleNotificationDelegate(std::move(callback))));
std::unique_ptr<Notification> notification =
system_notifier::CreateSystemNotification(
message_center::NOTIFICATION_TYPE_SIMPLE, kLocaleChangeNotificationId,
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_LOCALE_CHANGE_TITLE),
l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_LOCALE_CHANGE_MESSAGE,
from, to),
bundle.GetImageNamed(IDR_AURA_UBER_TRAY_LOCALE),
base::string16() /* display_source */, GURL(),
message_center::NotifierId(
message_center::NotifierId::SYSTEM_COMPONENT,
system_notifier::kNotifierLocale),
optional, new LocaleNotificationDelegate(std::move(callback)),
kNotificationSettingsIcon,
message_center::SystemNotificationWarningLevel::NORMAL);
message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
}
......
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