Commit db0cba00 authored by Ewann's avatar Ewann Committed by Commit Bot

[iOS] Adds dynamic string to action sheet

This CL adds a dynamic string to the action sheet that asks for
confirmation to avoid unwanted tab clearing.

Bug: 1119319
Change-Id: I42c28f820c7354d86c112b20fe003bd912116cfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362656
Commit-Queue: Ewann Pellé <ewannpv@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803528}
parent 0d1101f1
...@@ -2180,6 +2180,11 @@ Your data was encrypted with your sync passphrase on <ph name="TIME">$2<ex>Sept ...@@ -2180,6 +2180,11 @@ Your data was encrypted with your sync passphrase on <ph name="TIME">$2<ex>Sept
<message name="IDS_IOS_TAB_GRID_CLOSE_ALL_BUTTON" desc="Title of the button in the tab grid UI that closes all the tabs in the grid. [iOS only]"> <message name="IDS_IOS_TAB_GRID_CLOSE_ALL_BUTTON" desc="Title of the button in the tab grid UI that closes all the tabs in the grid. [iOS only]">
Close All Close All
</message> </message>
<message name="IDS_IOS_TAB_GRID_CLOSE_ALL_TABS_CONFIRMATION" desc="Title of the button in the action sheet that close all tabs. COUNT refers to the number of tabs open. According to its value, the string goes from singular to plural. [iOS only]">
{COUNT, plural,
=1 {Close {COUNT} Tab}
other {Close {COUNT} Tabs}}
</message>
<message name="IDS_IOS_TAB_GRID_UNDO_CLOSE_ALL_BUTTON" desc="Title of the button in the tab grid UI that revert the close all action recently taken by the user. [iOS only]"> <message name="IDS_IOS_TAB_GRID_UNDO_CLOSE_ALL_BUTTON" desc="Title of the button in the tab grid UI that revert the close all action recently taken by the user. [iOS only]">
Undo Undo
</message> </message>
......
4ac0436d4ea523f5783d0287fd8d460e94c53450
\ No newline at end of file
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h" #include "base/metrics/user_metrics_action.h"
#include "base/strings/sys_string_conversions.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/browser/chrome_url_constants.h"
...@@ -417,9 +418,11 @@ ...@@ -417,9 +418,11 @@
IsIPadIdiom() ? UIAlertControllerStyleAlert IsIPadIdiom() ? UIAlertControllerStyleAlert
: UIAlertControllerStyleActionSheet; : UIAlertControllerStyleActionSheet;
// TODO(crbug.com/1119319): Displays the number of tabs to close.
[self.actionSheetCoordinator [self.actionSheetCoordinator
addItemWithTitle:l10n_util::GetNSString(IDS_IOS_TAB_GRID_CLOSE_ALL_BUTTON) addItemWithTitle:base::SysUTF16ToNSString(
l10n_util::GetPluralStringFUTF16(
IDS_IOS_TAB_GRID_CLOSE_ALL_TABS_CONFIRMATION,
numberOfTabs))
action:^{ action:^{
base::RecordAction(base::UserMetricsAction( base::RecordAction(base::UserMetricsAction(
"MobileTabGridCloseAllTabsConfirmationConfirmed")); "MobileTabGridCloseAllTabsConfirmationConfirmed"));
......
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