Commit bf433ad6 authored by Ehimare Okoyomon's avatar Ehimare Okoyomon Committed by Commit Bot

Change cookie controls card and tooltip text for incognito ntp toggle

Add new string for incognito NTP toggle on desktop and android.
Android: https://screenshot.googleplex.com/0jkU80X35Tn.png
Desktop: https://screenshot.googleplex.com/UrfJiLVVfPt.png

Bug: 1059186
Change-Id: I8d286725b3241ec41e374514de2294a49682675a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089905
Commit-Queue: Ehimare Okoyomon <eokoyomon@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748014}
parent 4aec42aa
...@@ -32,8 +32,6 @@ import org.chromium.ui.text.NoUnderlineClickableSpan; ...@@ -32,8 +32,6 @@ import org.chromium.ui.text.NoUnderlineClickableSpan;
import org.chromium.ui.text.SpanApplier; import org.chromium.ui.text.SpanApplier;
import org.chromium.ui.widget.ChromeBulletSpan; import org.chromium.ui.widget.ChromeBulletSpan;
import java.util.Locale;
/** /**
* The view to describle incognito mode. * The view to describle incognito mode.
*/ */
...@@ -355,18 +353,8 @@ public class IncognitoDescriptionView extends LinearLayout { ...@@ -355,18 +353,8 @@ public class IncognitoDescriptionView extends LinearLayout {
break; break;
case CookieControlsEnforcement.ENFORCED_BY_COOKIE_SETTING: case CookieControlsEnforcement.ENFORCED_BY_COOKIE_SETTING:
iconRes = R.drawable.settings_cog; iconRes = R.drawable.settings_cog;
int placeholderTextId = addition = resources.getString(
R.string.new_tab_otr_cookie_controls_controlled_tooltip_text; R.string.new_tab_otr_cookie_controls_controlled_tooltip_text);
// Need to construct the string by replacing the placeholder text with the correct
// strings. However, since this text is shared with desktop, the placeholder
// characters for arguments are different, so we first need to swap in the correct
// placeholder characters.
// TODO(crbug.com/1040091): Look into changing this string on Android and Desktop
// to not use placeholders at all.
addition = String.format(Locale.getDefault(),
resources.getString(placeholderTextId).replaceAll("\\$(\\d+)", "%$1\\$s"),
resources.getString(R.string.block_third_party_cookies_title),
resources.getString(R.string.cookies_title));
break; break;
default: default:
return; return;
......
...@@ -328,10 +328,8 @@ void NTPResourceCache::CreateNewTabIncognitoHTML() { ...@@ -328,10 +328,8 @@ void NTPResourceCache::CreateNewTabIncognitoHTML() {
: "hidden"; : "hidden";
replacements["cookieControlsToolTipIcon"] = replacements["cookieControlsToolTipIcon"] =
CookieControlsHandler::GetEnforcementIcon(profile_); CookieControlsHandler::GetEnforcementIcon(profile_);
replacements["cookieControlsTooltipText"] = l10n_util::GetStringFUTF8( replacements["cookieControlsTooltipText"] = l10n_util::GetStringUTF8(
IDS_NEW_TAB_OTR_COOKIE_CONTROLS_CONTROLLED_TOOLTIP_TEXT, IDS_NEW_TAB_OTR_COOKIE_CONTROLS_CONTROLLED_TOOLTIP_TEXT);
l10n_util::GetStringUTF16(IDS_NEW_TAB_OTR_THIRD_PARTY_COOKIE),
l10n_util::GetStringUTF16(IDS_SETTINGS_SITE_SETTINGS_COOKIES));
const ui::ThemeProvider& tp = const ui::ThemeProvider& tp =
ThemeService::GetThemeProviderForProfile(profile_); ThemeService::GetThemeProviderForProfile(profile_);
......
...@@ -168,13 +168,13 @@ ...@@ -168,13 +168,13 @@
<message name="IDS_NEW_TAB_OTR_COOKIE_CONTROLS_CONTROLLED_TOOLTIP_TEXT" <message name="IDS_NEW_TAB_OTR_COOKIE_CONTROLS_CONTROLLED_TOOLTIP_TEXT"
desc="Text displayed in the settings tooltip when third-party cookie blocking is managed or turned on by the user." desc="Text displayed in the settings tooltip when third-party cookie blocking is managed or turned on by the user."
formatter_data="android_java"> formatter_data="android_java">
This setting is enforced by &quot;<ph name="ENFORCING_SETTING">$1<ex>Block third-party cookies</ex></ph>&quot; in &quot;<ph name="SETTINGS_PAGE">$2<ex>Cookies and site data</ex></ph>&quot; This setting is controlled in Cookies settings.
</message> </message>
<message name="IDS_NEW_TAB_OTR_THIRD_PARTY_COOKIE" desc="Label for the Block 3rd-party cookie checkbox on the Cookies category." formatter_data="android_java"> <message name="IDS_NEW_TAB_OTR_THIRD_PARTY_COOKIE" desc="Label for the Block 3rd-party cookie checkbox on the Cookies category." formatter_data="android_java">
Block third-party cookies Block third-party cookies
</message> </message>
<message name="IDS_NEW_TAB_OTR_THIRD_PARTY_COOKIE_SUBLABEL" desc="A sub-label below the Block 3rd-party cookie checkbox." formatter_data="android_java"> <message name="IDS_NEW_TAB_OTR_THIRD_PARTY_COOKIE_SUBLABEL" desc="A sub-label below the Block 3rd-party cookie checkbox." formatter_data="android_java">
When on, sites can’t use your browsing activity across different sites to personalize ads. Some sites may not work properly. When on, sites can’t use your browsing activity across different sites to personalize ads. Features on some sites may break.
</message> </message>
</grit-part> </grit-part>
f8a8e5dfdb6cc86ed7aec35d9b9d2f327af15cc9 c11000cf578969abb6b9f47ce8c87cf33840c3a5
\ No newline at end of file \ No newline at end of file
98db02408261e170777242721a61bcfb6ed248dc 5e55b66b9d0bbf98a85ff7ecfc246ed18d79f986
\ No newline at end of file \ No newline at end of file
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