Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3193)

Unified Diff: chrome/browser/ui/webui/history_ui.cc

Issue 2077483002: MD History: Add confirmation dialog when deleting items from the toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cr_refactor_dialog
Patch Set: Address nits Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/history_ui.h ('k') | chrome/browser/ui/webui/md_history_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/history_ui.cc
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index 5e0ec9e064cce56e5ae5c93ae32b3e59f5fd0f97..c80543e8a075c6f04fe28b7ecc4b34f2e1b1c159 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -101,13 +101,8 @@ content::WebUIDataSource* CreateHistoryUIHTMLSource(Profile* profile) {
source->AddLocalizedString("clearAllHistory",
IDS_HISTORY_OPEN_CLEAR_BROWSING_DATA_DIALOG);
- auto availability = IncognitoModePrefs::GetAvailability(profile->GetPrefs());
- base::string16 delete_warning = availability == IncognitoModePrefs::ENABLED ?
- l10n_util::GetStringFUTF16(IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING,
- base::UTF8ToUTF16(kIncognitoModeShortcut)) :
- l10n_util::GetStringUTF16(
- IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING_NO_INCOGNITO);
- source->AddString("deleteWarning", delete_warning);
+ source->AddString("deleteWarning",
+ HistoryUI::GetDeleteWarningString(profile));
source->AddLocalizedString("removeBookmark", IDS_HISTORY_REMOVE_BOOKMARK);
source->AddLocalizedString("actionMenuDescription",
@@ -204,3 +199,14 @@ base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes(
return ResourceBundle::GetSharedInstance().
LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor);
}
+
+// static
+base::string16 HistoryUI::GetDeleteWarningString(Profile* profile) {
+ auto availability = IncognitoModePrefs::GetAvailability(profile->GetPrefs());
+ return availability == IncognitoModePrefs::ENABLED
+ ? l10n_util::GetStringFUTF16(
+ IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING,
+ base::UTF8ToUTF16(kIncognitoModeShortcut))
+ : l10n_util::GetStringUTF16(
+ IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING_NO_INCOGNITO);
+}
« no previous file with comments | « chrome/browser/ui/webui/history_ui.h ('k') | chrome/browser/ui/webui/md_history_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698