Commit 844900c4 authored by Jian Li's avatar Jian Li Committed by Commit Bot

More UI string updates for experiment changing incognito to private

Launch bug: 863984

Bug: 865140
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:linux_vr;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I021aa78fd002dc74a8c9965afce1906bdff7acdb
Reviewed-on: https://chromium-review.googlesource.com/1161217
Commit-Queue: Jian Li <jianli@chromium.org>
Reviewed-by: default avatarMathieu Perreault <mathp@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580625}
parent 74838e5d
...@@ -83,9 +83,15 @@ public class IncognitoNewTabPage ...@@ -83,9 +83,15 @@ public class IncognitoNewTabPage
(IncognitoNewTabPageView) inflater.inflate(getLayoutResource(), null); (IncognitoNewTabPageView) inflater.inflate(getLayoutResource(), null);
mIncognitoNewTabPageView.initialize(mIncognitoNewTabPageManager); mIncognitoNewTabPageView.initialize(mIncognitoNewTabPageManager);
if (!useMDIncognitoNTP()) { boolean useAlternateIncognitoStrings =
boolean useAlternateIncognitoStrings = ChromeFeatureList.isEnabled(ChromeFeatureList.INCOGNITO_STRINGS);
ChromeFeatureList.isEnabled(ChromeFeatureList.INCOGNITO_STRINGS); if (useMDIncognitoNTP()) {
TextView newTabIncognitoHeader =
(TextView) mIncognitoNewTabPageView.findViewById(R.id.new_tab_incognito_title);
newTabIncognitoHeader.setText(useAlternateIncognitoStrings
? R.string.new_tab_private_title
: R.string.new_tab_otr_title);
} else {
TextView newTabIncognitoHeader = TextView newTabIncognitoHeader =
(TextView) mIncognitoNewTabPageView.findViewById(R.id.ntp_incognito_header); (TextView) mIncognitoNewTabPageView.findViewById(R.id.ntp_incognito_header);
newTabIncognitoHeader.setText(useAlternateIncognitoStrings newTabIncognitoHeader.setText(useAlternateIncognitoStrings
......
...@@ -25,6 +25,7 @@ import org.chromium.base.ContextUtils; ...@@ -25,6 +25,7 @@ import org.chromium.base.ContextUtils;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.components.url_formatter.UrlFormatter; import org.chromium.components.url_formatter.UrlFormatter;
import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.browser.WebContents;
import org.chromium.payments.mojom.PaymentCurrencyAmount; import org.chromium.payments.mojom.PaymentCurrencyAmount;
...@@ -296,12 +297,14 @@ public class AndroidPaymentApp ...@@ -296,12 +297,14 @@ public class AndroidPaymentApp
new AlertDialog.Builder(activity, R.style.AlertDialogTheme) new AlertDialog.Builder(activity, R.style.AlertDialogTheme)
.setTitle(R.string.external_app_leave_incognito_warning_title) .setTitle(R.string.external_app_leave_incognito_warning_title)
.setMessage(R.string.external_payment_app_leave_incognito_warning) .setMessage(ChromeFeatureList.isEnabled(ChromeFeatureList.INCOGNITO_STRINGS)
? R.string.external_payment_app_leave_private_warning
: R.string.external_payment_app_leave_incognito_warning)
.setPositiveButton(R.string.ok, .setPositiveButton(R.string.ok,
(OnClickListener) (dialog, which) -> launchPaymentApp(id, merchantName, (OnClickListener) (dialog, which)
schemelessOrigin, -> launchPaymentApp(id, merchantName, schemelessOrigin,
schemelessIframeOrigin, certificateChain, methodDataMap, schemelessIframeOrigin, certificateChain, methodDataMap,
total, displayItems, modifiers)) total, displayItems, modifiers))
.setNegativeButton(R.string.cancel, .setNegativeButton(R.string.cancel,
(OnClickListener) (dialog, which) -> notifyErrorInvokingPaymentApp()) (OnClickListener) (dialog, which) -> notifyErrorInvokingPaymentApp())
.setOnCancelListener(dialog -> notifyErrorInvokingPaymentApp()) .setOnCancelListener(dialog -> notifyErrorInvokingPaymentApp())
......
...@@ -20,6 +20,7 @@ import android.widget.TextView; ...@@ -20,6 +20,7 @@ import android.widget.TextView;
import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.components.ui_metrics.SadTabEvent; import org.chromium.components.ui_metrics.SadTabEvent;
import org.chromium.ui.text.NoUnderlineClickableSpan; import org.chromium.ui.text.NoUnderlineClickableSpan;
import org.chromium.ui.text.SpanApplier; import org.chromium.ui.text.SpanApplier;
...@@ -119,7 +120,10 @@ public class SadTabViewFactory { ...@@ -119,7 +120,10 @@ public class SadTabViewFactory {
SpannableStringBuilder spannableString = new SpannableStringBuilder(); SpannableStringBuilder spannableString = new SpannableStringBuilder();
if (!isIncognito) { if (!isIncognito) {
spannableString spannableString
.append(generateBulletedString(context, R.string.sad_tab_reload_incognito)) .append(generateBulletedString(context,
ChromeFeatureList.isEnabled(ChromeFeatureList.INCOGNITO_STRINGS)
? R.string.sad_tab_reload_private
: R.string.sad_tab_reload_incognito))
.append("\n"); .append("\n");
} }
spannableString spannableString
......
...@@ -104,12 +104,18 @@ ...@@ -104,12 +104,18 @@
<message name="IDS_VR_MENU_NEW_INCOGNITO_TAB" desc="Menu item for opening a new incognito tab that facilitates pseudononymous browsing. [CHAR-LIMIT=27]"> <message name="IDS_VR_MENU_NEW_INCOGNITO_TAB" desc="Menu item for opening a new incognito tab that facilitates pseudononymous browsing. [CHAR-LIMIT=27]">
New incognito tab New incognito tab
</message> </message>
<message name="IDS_VR_MENU_NEW_PRIVATE_TAB" desc="Menu item for opening a new private tab that facilitates pseudononymous browsing. [CHAR-LIMIT=27]">
New private tab
</message>
<message name="IDS_VR_MENU_PREFERENCES" desc="Menu item for opening browser preferences. [CHAR-LIMIT=27]"> <message name="IDS_VR_MENU_PREFERENCES" desc="Menu item for opening browser preferences. [CHAR-LIMIT=27]">
Settings Settings
</message> </message>
<message name="IDS_VR_MENU_CLOSE_INCOGNITO_TABS" desc="Menu item for closing all open incognito tabs. [CHAR-LIMIT=27]"> <message name="IDS_VR_MENU_CLOSE_INCOGNITO_TABS" desc="Menu item for closing all open incognito tabs. [CHAR-LIMIT=27]">
Close incognito tabs Close incognito tabs
</message> </message>
<message name="IDS_VR_MENU_CLOSE_PRIVATE_TABS" desc="Menu item for closing all open private tabs. [CHAR-LIMIT=27]">
Close private tabs
</message>
<message name="IDS_VR_TABS_BUTTON_REGULAR" desc="Text on button for selecting regular tabs"> <message name="IDS_VR_TABS_BUTTON_REGULAR" desc="Text on button for selecting regular tabs">
Tabs Tabs
</message> </message>
......
...@@ -4196,7 +4196,7 @@ const FeatureEntry kFeatureEntries[] = { ...@@ -4196,7 +4196,7 @@ const FeatureEntry kFeatureEntries[] = {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
{"incognito-strings", flag_descriptions::kIncognitoStringsName, {"incognito-strings", flag_descriptions::kIncognitoStringsName,
flag_descriptions::kIncognitoStringsDescription, kOsAndroid, flag_descriptions::kIncognitoStringsDescription, kOsAndroid,
FEATURE_VALUE_TYPE(chrome::android::kIncognitoStrings)}, FEATURE_VALUE_TYPE(features::kIncognitoStrings)},
#endif #endif
{"enable-idn-navigation-suggestions", {"enable-idn-navigation-suggestions",
......
...@@ -59,6 +59,7 @@ const base::Feature* kFeaturesExposedToJava[] = { ...@@ -59,6 +59,7 @@ const base::Feature* kFeaturesExposedToJava[] = {
&features::kExperimentalAppBanners, &features::kExperimentalAppBanners,
&features::kExperimentalUi, &features::kExperimentalUi,
&features::kGenericSensorExtraClasses, &features::kGenericSensorExtraClasses,
&features::kIncognitoStrings,
&features::kMaterialDesignIncognitoNTP, &features::kMaterialDesignIncognitoNTP,
&features::kPermissionDelegation, &features::kPermissionDelegation,
&features::kServiceWorkerPaymentApps, &features::kServiceWorkerPaymentApps,
...@@ -109,7 +110,6 @@ const base::Feature* kFeaturesExposedToJava[] = { ...@@ -109,7 +110,6 @@ const base::Feature* kFeaturesExposedToJava[] = {
&kHomepageTile, &kHomepageTile,
&kHorizontalTabSwitcherAndroid, &kHorizontalTabSwitcherAndroid,
&kImprovedA2HS, &kImprovedA2HS,
&kIncognitoStrings,
&kLanguagesPreference, &kLanguagesPreference,
&kLongPressBackForHistory, &kLongPressBackForHistory,
&kLongPressBackNewDesign, &kLongPressBackNewDesign,
...@@ -315,9 +315,6 @@ const base::Feature kHorizontalTabSwitcherAndroid{ ...@@ -315,9 +315,6 @@ const base::Feature kHorizontalTabSwitcherAndroid{
const base::Feature kImprovedA2HS{"ImprovedA2HS", const base::Feature kImprovedA2HS{"ImprovedA2HS",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kIncognitoStrings{"IncognitoStrings",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kLanguagesPreference{"LanguagesPreference", const base::Feature kLanguagesPreference{"LanguagesPreference",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
......
...@@ -55,7 +55,6 @@ extern const base::Feature kHomePageButtonForceEnabled; ...@@ -55,7 +55,6 @@ extern const base::Feature kHomePageButtonForceEnabled;
extern const base::Feature kHomepageTile; extern const base::Feature kHomepageTile;
extern const base::Feature kHorizontalTabSwitcherAndroid; extern const base::Feature kHorizontalTabSwitcherAndroid;
extern const base::Feature kImprovedA2HS; extern const base::Feature kImprovedA2HS;
extern const base::Feature kIncognitoStrings;
extern const base::Feature kLanguagesPreference; extern const base::Feature kLanguagesPreference;
extern const base::Feature kLongPressBackForHistory; extern const base::Feature kLongPressBackForHistory;
extern const base::Feature kLongPressBackNewDesign; extern const base::Feature kLongPressBackNewDesign;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/numerics/math_constants.h" #include "base/numerics/math_constants.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "cc/animation/animation_curve.h" #include "cc/animation/animation_curve.h"
#include "cc/animation/animation_target.h" #include "cc/animation/animation_target.h"
#include "cc/animation/keyframe_effect.h" #include "cc/animation/keyframe_effect.h"
...@@ -2401,14 +2402,22 @@ void UiSceneCreator::CreateOverflowMenu() { ...@@ -2401,14 +2402,22 @@ void UiSceneCreator::CreateOverflowMenu() {
base::RepeatingCallback<void(UiBrowserInterface*)> action; base::RepeatingCallback<void(UiBrowserInterface*)> action;
base::RepeatingCallback<bool(Model*)> visibility; base::RepeatingCallback<bool(Model*)> visibility;
}; };
int new_incognito_tab_res_id = IDS_VR_MENU_NEW_INCOGNITO_TAB;
int close_incognito_tabs_res_id = IDS_VR_MENU_CLOSE_INCOGNITO_TABS;
#if defined(OS_ANDROID)
if (base::FeatureList::IsEnabled(features::kIncognitoStrings)) {
new_incognito_tab_res_id = IDS_VR_MENU_NEW_PRIVATE_TAB;
close_incognito_tabs_res_id = IDS_VR_MENU_CLOSE_PRIVATE_TABS;
}
#endif // defined(OS_ANDROID)
std::vector<MenuItem> menu_items = { std::vector<MenuItem> menu_items = {
{ {
kOverflowMenuNewIncognitoTabItem, IDS_VR_MENU_NEW_INCOGNITO_TAB, kOverflowMenuNewIncognitoTabItem, new_incognito_tab_res_id,
base::BindRepeating( base::BindRepeating(
[](UiBrowserInterface* browser) { browser->OpenNewTab(true); }), [](UiBrowserInterface* browser) { browser->OpenNewTab(true); }),
base::BindRepeating([](Model* m) { return !m->incognito; }), base::BindRepeating([](Model* m) { return !m->incognito; }),
}, },
{kOverflowMenuCloseAllIncognitoTabsItem, IDS_VR_MENU_CLOSE_INCOGNITO_TABS, {kOverflowMenuCloseAllIncognitoTabsItem, close_incognito_tabs_res_id,
base::BindRepeating([](UiBrowserInterface* browser) { base::BindRepeating([](UiBrowserInterface* browser) {
browser->CloseAllIncognitoTabs(); browser->CloseAllIncognitoTabs();
}), }),
......
...@@ -670,4 +670,10 @@ extern const base::Feature kWebRtcRemoteEventLogGzipped{ ...@@ -670,4 +670,10 @@ extern const base::Feature kWebRtcRemoteEventLogGzipped{
const base::Feature kWin10AcceleratedDefaultBrowserFlow{ const base::Feature kWin10AcceleratedDefaultBrowserFlow{
"Win10AcceleratedDefaultBrowserFlow", base::FEATURE_DISABLED_BY_DEFAULT}; "Win10AcceleratedDefaultBrowserFlow", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
#if defined(OS_ANDROID)
// Enables showing alternative incognito strings.
const base::Feature kIncognitoStrings{"IncognitoStrings",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif // defined(OS_ANDROID)
} // namespace features } // namespace features
...@@ -364,6 +364,10 @@ extern const base::Feature kWebRtcRemoteEventLogGzipped; ...@@ -364,6 +364,10 @@ extern const base::Feature kWebRtcRemoteEventLogGzipped;
extern const base::Feature kWin10AcceleratedDefaultBrowserFlow; extern const base::Feature kWin10AcceleratedDefaultBrowserFlow;
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
#if defined(OS_ANDROID)
extern const base::Feature kIncognitoStrings;
#endif // defined(OS_ANDROID)
bool PrefServiceEnabled(); bool PrefServiceEnabled();
// DON'T ADD RANDOM STUFF HERE. Put it in the main section above in // DON'T ADD RANDOM STUFF HERE. Put it in the main section above in
......
...@@ -60,6 +60,9 @@ ...@@ -60,6 +60,9 @@
<message name="IDS_SAD_TAB_RELOAD_INCOGNITO" desc="One of the bullet points displayed on the web page if a reload failed to fix the issue, advising the user to open the web page in Chrome's Incognito mode." formatter_data="android_java"> <message name="IDS_SAD_TAB_RELOAD_INCOGNITO" desc="One of the bullet points displayed on the web page if a reload failed to fix the issue, advising the user to open the web page in Chrome's Incognito mode." formatter_data="android_java">
Open page in a new Incognito tab Open page in a new Incognito tab
</message> </message>
<message name="IDS_SAD_TAB_RELOAD_PRIVATE" desc="One of the bullet points displayed on the web page if a reload failed to fix the issue, advising the user to open the web page in Chrome's private mode. Note that 'Private' is used as a different name for 'Incognito'." formatter_data="android_java">
Open page in a new Private tab
</message>
</if> </if>
<if expr="is_macosx or chromeos"> <if expr="is_macosx or chromeos">
<message name="IDS_SAD_TAB_RELOAD_CLOSE_TABS" desc="One of the bullet points displayed on the web page if a reload failed to fix the issue, advising the user to close other Chrome tabs or apps running on their computer (Mac, Chrome OS)."> <message name="IDS_SAD_TAB_RELOAD_CLOSE_TABS" desc="One of the bullet points displayed on the web page if a reload failed to fix the issue, advising the user to close other Chrome tabs or apps running on their computer (Mac, Chrome OS).">
...@@ -141,6 +144,9 @@ ...@@ -141,6 +144,9 @@
<message name="IDS_NEW_TAB_OTR_TITLE" desc="Title of the Incognito new tab page. The Incognito mode provides private browsing experience by hiding browsing activity from other people using the same device. However, it does not make the user completely invisible or anonymous; please don't translate it as such." formatter_data="android_java"> <message name="IDS_NEW_TAB_OTR_TITLE" desc="Title of the Incognito new tab page. The Incognito mode provides private browsing experience by hiding browsing activity from other people using the same device. However, it does not make the user completely invisible or anonymous; please don't translate it as such." formatter_data="android_java">
You’ve gone incognito You’ve gone incognito
</message> </message>
<message name="IDS_NEW_TAB_PRIVATE_TITLE" desc="Title of the Private new tab page. The Private mode provides private browsing experience by hiding browsing activity from other people using the same device. However, it does not make the user completely invisible or anonymous; please don't translate it as such. Note that 'Private' is used as a different name for 'Incognito'." formatter_data="android_java">
You’ve gone private
</message>
<message name="IDS_NEW_TAB_OTR_SUBTITLE" desc="Subtitle of the Incognito new tab page, explaining to the user that the Incognito mode hides their browsing activity from other people using the same device. The second sentence clarifies that there are two important exceptions from this rule - downloaded files and added bookmarks will be persisted even after the Incognito session is closed." formatter_data="android_java"> <message name="IDS_NEW_TAB_OTR_SUBTITLE" desc="Subtitle of the Incognito new tab page, explaining to the user that the Incognito mode hides their browsing activity from other people using the same device. The second sentence clarifies that there are two important exceptions from this rule - downloaded files and added bookmarks will be persisted even after the Incognito session is closed." formatter_data="android_java">
Now you can browse privately, and other people who use this device won’t see your activity. However, downloads and bookmarks will be saved. Now you can browse privately, and other people who use this device won’t see your activity. However, downloads and bookmarks will be saved.
</message> </message>
......
...@@ -585,6 +585,9 @@ ...@@ -585,6 +585,9 @@
<message name="IDS_EXTERNAL_PAYMENT_APP_LEAVE_INCOGNITO_WARNING" desc="Alert dialog text warning the user that incognito mode does not continue into external payment apps." formatter_data="android_java"> <message name="IDS_EXTERNAL_PAYMENT_APP_LEAVE_INCOGNITO_WARNING" desc="Alert dialog text warning the user that incognito mode does not continue into external payment apps." formatter_data="android_java">
Leaving incognito mode to pay via an external application. Continue? Leaving incognito mode to pay via an external application. Continue?
</message> </message>
<message name="IDS_EXTERNAL_PAYMENT_APP_LEAVE_PRIVATE_WARNING" desc="Alert dialog text warning the user that private mode does not continue into external payment apps." formatter_data="android_java">
Leaving private mode to pay via an external application. Continue?
</message>
</if> </if>
<!-- Payment Request section preview strings. They are slightly different on desktop and android because the pluralization and formatting code behaves differently. --> <!-- Payment Request section preview strings. They are slightly different on desktop and android because the pluralization and formatting code behaves differently. -->
......
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