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

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

Issue 1586373002: MD History: Delete button in the toolbar allows deletion of multiple history-items. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch_to_be_uploaded
Patch Set: Add TODO and remove console.logs. Created 4 years, 11 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
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 a59e42fd327d5e032a10df6a8aa21fb4bd6a7861..fdd25b1d1dcf56ba9e7e6702cf025d99b18ff4a5 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"
#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);
@@ -54,6 +59,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);
tsergeant 2016/01/18 02:33:52 Hmmmmmmmmmm, we'd better make sure there's a test
tsergeant 2016/01/18 02:35:59 (to be extra-clear, I'd like to see a test for thi
hsampson 2016/01/19 23:41:39 Done.
+
return source;
}
@@ -72,7 +81,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() {}

Powered by Google App Engine
This is Rietveld 408576698