Commit b0ac69e5 authored by Nohemi Fernandez's avatar Nohemi Fernandez Committed by Commit Bot

[iOS] Add separate title and message texts to sign-in notification.

Previously, we only had the ability to include a title text in an
infobar. Following crrev.com/c/2521619 we are able to include both.

This patch updates sign-in notification infobar to include a title,
"Signed in to Chrome" and the user email as the message.

Bug: 1145592
Change-Id: Ibd1b91737d3cfd6d30ea15cdec5fd11f49cba268
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526105Reviewed-by: default avatarChris Lu <thegreenfrog@chromium.org>
Commit-Queue: Nohemi Fernandez <fernandex@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825741}
parent 6d80bc1f
...@@ -44,6 +44,7 @@ class SigninNotificationInfoBarDelegate : public ConfirmInfoBarDelegate { ...@@ -44,6 +44,7 @@ class SigninNotificationInfoBarDelegate : public ConfirmInfoBarDelegate {
InfoBarIdentifier GetIdentifier() const override; InfoBarIdentifier GetIdentifier() const override;
// ConfirmInfoBarDelegate implementation. // ConfirmInfoBarDelegate implementation.
base::string16 GetTitleText() const override;
base::string16 GetMessageText() const override; base::string16 GetMessageText() const override;
int GetButtons() const override; int GetButtons() const override;
base::string16 GetButtonLabel(InfoBarButton button) const override; base::string16 GetButtonLabel(InfoBarButton button) const override;
...@@ -52,6 +53,7 @@ class SigninNotificationInfoBarDelegate : public ConfirmInfoBarDelegate { ...@@ -52,6 +53,7 @@ class SigninNotificationInfoBarDelegate : public ConfirmInfoBarDelegate {
private: private:
gfx::Image icon_; gfx::Image icon_;
base::string16 title_;
base::string16 message_; base::string16 message_;
base::string16 button_text_; base::string16 button_text_;
......
...@@ -78,14 +78,15 @@ SigninNotificationInfoBarDelegate::SigninNotificationInfoBarDelegate( ...@@ -78,14 +78,15 @@ SigninNotificationInfoBarDelegate::SigninNotificationInfoBarDelegate(
if (base::FeatureList::IsEnabled( if (base::FeatureList::IsEnabled(
signin::kSigninNotificationInfobarUsernameInTitle)) { signin::kSigninNotificationInfobarUsernameInTitle)) {
message_ = base::SysNSStringToUTF16(l10n_util::GetNSStringF( title_ = base::SysNSStringToUTF16(l10n_util::GetNSStringF(
IDS_IOS_SIGNIN_ACCOUNT_NOTIFICATION_TITLE_WITH_USERNAME, IDS_IOS_SIGNIN_ACCOUNT_NOTIFICATION_TITLE_WITH_USERNAME,
base::SysNSStringToUTF16(identity.userFullName))); base::SysNSStringToUTF16(identity.userFullName)));
} else { } else {
message_ = base::SysNSStringToUTF16( title_ = base::SysNSStringToUTF16(
l10n_util::GetNSString(IDS_IOS_SIGNIN_ACCOUNT_NOTIFICATION_TITLE)); l10n_util::GetNSString(IDS_IOS_SIGNIN_ACCOUNT_NOTIFICATION_TITLE));
} }
message_ = base::SysNSStringToUTF16(identity.userEmail);
button_text_ = button_text_ =
base::SysNSStringToUTF16(l10n_util::GetNSString(IDS_IOS_SETTINGS_TITLE)); base::SysNSStringToUTF16(l10n_util::GetNSString(IDS_IOS_SETTINGS_TITLE));
} }
...@@ -97,6 +98,10 @@ SigninNotificationInfoBarDelegate::GetIdentifier() const { ...@@ -97,6 +98,10 @@ SigninNotificationInfoBarDelegate::GetIdentifier() const {
return RE_SIGN_IN_INFOBAR_DELEGATE_IOS; return RE_SIGN_IN_INFOBAR_DELEGATE_IOS;
} }
base::string16 SigninNotificationInfoBarDelegate::GetTitleText() const {
return title_;
}
base::string16 SigninNotificationInfoBarDelegate::GetMessageText() const { base::string16 SigninNotificationInfoBarDelegate::GetMessageText() const {
return message_; return message_;
} }
......
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