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

Unified Diff: chrome/browser/resources/history/history.js

Issue 957253003: Fix chrome://history for supervised users on mobile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 5 years, 10 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/resources/history/history.css ('k') | chrome/browser/resources/history/history_mobile.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/history/history.js
diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js
index 61c46a08cf6badac5836d46aff92873dfe3562d6..85542c1d12dad82507ecf1082b98fb693a80b019 100644
--- a/chrome/browser/resources/history/history.js
+++ b/chrome/browser/resources/history/history.js
@@ -192,8 +192,7 @@ Visit.prototype.getResultDOM = function(propertyBag) {
this.id_ = this.model_.getNextVisitId();
var self = this;
- // Only create the checkbox if it can be used either to delete an entry or to
- // block/allow it.
+ // Only create the checkbox if it can be used to delete an entry.
if (this.model_.editingEntriesAllowed) {
var checkbox = document.createElement('input');
checkbox.type = 'checkbox';
@@ -277,21 +276,23 @@ Visit.prototype.getResultDOM = function(propertyBag) {
}
if (isMobileVersion()) {
- var removeButton = createElementWithClassName('button', 'remove-entry');
- removeButton.setAttribute('aria-label',
- loadTimeData.getString('removeFromHistory'));
- removeButton.classList.add('custom-appearance');
- removeButton.addEventListener(
- 'click', this.removeEntryFromHistory_.bind(this));
- entryBox.appendChild(removeButton);
-
- // Support clicking anywhere inside the entry box.
- entryBox.addEventListener('click', function(e) {
- if (!e.defaultPrevented) {
- self.titleLink.focus();
- self.titleLink.click();
- }
- });
+ if (this.model_.editingEntriesAllowed) {
+ var removeButton = createElementWithClassName('button', 'remove-entry');
+ removeButton.setAttribute('aria-label',
+ loadTimeData.getString('removeFromHistory'));
+ removeButton.classList.add('custom-appearance');
+ removeButton.addEventListener(
+ 'click', this.removeEntryFromHistory_.bind(this));
+ entryBox.appendChild(removeButton);
+
+ // Support clicking anywhere inside the entry box.
+ entryBox.addEventListener('click', function(e) {
+ if (!e.defaultPrevented) {
+ self.titleLink.focus();
+ self.titleLink.click();
+ }
+ });
+ }
} else {
var dropDown = createElementWithClassName('button', 'drop-down');
dropDown.value = 'Open action menu';
« no previous file with comments | « chrome/browser/resources/history/history.css ('k') | chrome/browser/resources/history/history_mobile.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698