Commit 44556d9c authored by tsergeant's avatar tsergeant Committed by Commit bot

MD History: UI polish pass

* Remove 'Psst' notice from delete confirmation dialog
* Increase line-height of 'other forms of history' notice to 20px

BUG=425625
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2195263002
Cr-Commit-Position: refs/heads/master@{#408911}
parent 8f125bdd
......@@ -88,6 +88,7 @@
#footer-text {
-webkit-padding-end: 16px;
-webkit-padding-start: 24px;
line-height: 20px;
margin: 24px 0;
}
......
......@@ -101,8 +101,14 @@ content::WebUIDataSource* CreateHistoryUIHTMLSource(Profile* profile) {
source->AddLocalizedString("clearAllHistory",
IDS_HISTORY_OPEN_CLEAR_BROWSING_DATA_DIALOG);
source->AddString("deleteWarning",
HistoryUI::GetDeleteWarningString(profile));
auto availability = IncognitoModePrefs::GetAvailability(profile->GetPrefs());
base::string16 delete_string = 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_string);
source->AddLocalizedString("removeBookmark", IDS_HISTORY_REMOVE_BOOKMARK);
source->AddLocalizedString("actionMenuDescription",
......@@ -199,14 +205,3 @@ 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);
}
......@@ -23,10 +23,6 @@ class HistoryUI : public content::WebUIController {
static base::RefCountedMemory* GetFaviconResourceBytes(
ui::ScaleFactor scale_factor);
// Returns a localized string warning about deleting history. Takes into
// account whether or not incognito mode is available.
static base::string16 GetDeleteWarningString(Profile* profile);
private:
DISALLOW_COPY_AND_ASSIGN(HistoryUI);
};
......
......@@ -11,7 +11,6 @@
#include "chrome/browser/ui/webui/browsing_history_handler.h"
#include "chrome/browser/ui/webui/foreign_session_handler.h"
#include "chrome/browser/ui/webui/history_login_handler.h"
#include "chrome/browser/ui/webui/history_ui.h"
#include "chrome/browser/ui/webui/metrics_handler.h"
#include "chrome/browser/ui/webui/settings/people_handler.h"
#include "chrome/common/chrome_features.h"
......@@ -48,6 +47,8 @@ content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile) {
source->AddLocalizedString("delete", IDS_MD_HISTORY_DELETE);
source->AddLocalizedString("deleteConfirm",
IDS_HISTORY_DELETE_PRIOR_VISITS_CONFIRM_BUTTON);
source->AddLocalizedString(
"deleteWarning", IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING_NO_INCOGNITO);
source->AddLocalizedString("foundSearchResults",
IDS_HISTORY_FOUND_SEARCH_RESULTS);
source->AddLocalizedString("historyInterval", IDS_HISTORY_INTERVAL);
......@@ -84,8 +85,6 @@ content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile) {
IDS_MD_HISTORY_SIGN_IN_PROMO_DESC);
source->AddLocalizedString("title", IDS_HISTORY_TITLE);
source->AddString("deleteWarning",
HistoryUI::GetDeleteWarningString(profile));
source->AddString(
"sidebarFooter",
l10n_util::GetStringFUTF16(
......
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