| Index: chrome/browser/ui/webui/md_history_ui.cc
|
| diff --git a/chrome/browser/ui/webui/md_history_ui.cc b/chrome/browser/ui/webui/md_history_ui.cc
|
| index f7672357b0fb6367af95c43e08a0079d7d57844c..773831a7c8510e761cf9c1496dab3dc02ba1335f 100644
|
| --- a/chrome/browser/ui/webui/md_history_ui.cc
|
| +++ b/chrome/browser/ui/webui/md_history_ui.cc
|
| @@ -8,7 +8,9 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/ui/webui/browsing_history_handler.h"
|
| #include "chrome/browser/ui/webui/metrics_handler.h"
|
| +#include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| +#include "components/prefs/pref_service.h"
|
| #include "components/search/search.h"
|
| #include "content/public/browser/web_ui.h"
|
| #include "content/public/browser/web_ui_data_source.h"
|
| @@ -26,7 +28,9 @@
|
|
|
| namespace {
|
|
|
| -content::WebUIDataSource* CreateMdHistoryUIHTMLSource() {
|
| +content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile) {
|
| + PrefService* prefs = profile->GetPrefs();
|
| +
|
| content::WebUIDataSource* source =
|
| content::WebUIDataSource::Create(chrome::kChromeUIHistoryHost);
|
|
|
| @@ -40,6 +44,10 @@ content::WebUIDataSource* CreateMdHistoryUIHTMLSource() {
|
| source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH);
|
| source->AddLocalizedString("title", IDS_HISTORY_TITLE);
|
|
|
| + bool allow_deleting_history =
|
| + prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory);
|
| + source->AddBoolean("allowDeletingHistory", allow_deleting_history);
|
| +
|
| source->AddResourcePath("history_card.html",
|
| IDR_MD_HISTORY_HISTORY_CARD_HTML);
|
| source->AddResourcePath("history_card.js", IDR_MD_HISTORY_HISTORY_CARD_JS);
|
| @@ -77,7 +85,7 @@ MdHistoryUI::MdHistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) {
|
| #endif
|
|
|
| Profile* profile = Profile::FromWebUI(web_ui);
|
| - content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource());
|
| + content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile));
|
| }
|
|
|
| MdHistoryUI::~MdHistoryUI() {}
|
|
|