Chromium Code Reviews| 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 552df3cebf3ae95fad48a554fdf83277e0d05d46..5dabeb42e56305890632d02762bd89b300be5b2d 100644 |
| --- a/chrome/browser/ui/webui/md_history_ui.cc |
| +++ b/chrome/browser/ui/webui/md_history_ui.cc |
| @@ -4,10 +4,13 @@ |
| #include "chrome/browser/ui/webui/md_history_ui.h" |
| +#include "base/prefs/pref_service.h" |
| #include "build/build_config.h" |
| +#include "chrome/browser/prefs/incognito_mode_prefs.h" |
|
calamity
2016/01/21 00:11:09
Unneeded?
hsampson
2016/01/21 05:34:47
Done.
|
| #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/search/search.h" |
| #include "content/public/browser/web_ui.h" |
| @@ -25,7 +28,9 @@ |
| namespace { |
| -content::WebUIDataSource* CreateMdHistoryUIHTMLSource() { |
| +content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile) { |
| + PrefService* prefs = profile->GetPrefs(); |
| + |
| content::WebUIDataSource* source = |
| content::WebUIDataSource::Create(chrome::kChromeUIHistoryHost); |
| @@ -55,6 +60,10 @@ content::WebUIDataSource* CreateMdHistoryUIHTMLSource() { |
| source->SetDefaultResource(IDR_MD_HISTORY_HISTORY_HTML); |
| source->SetJsonPath("strings.js"); |
| + bool allow_deleting_history = |
| + prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); |
| + source->AddBoolean("allowDeletingHistory", allow_deleting_history); |
| + |
| return source; |
| } |
| @@ -73,7 +82,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() {} |