Commit 53bf6318 authored by treib's avatar treib Committed by Commit bot

Fix chrome://history for supervised users on mobile

- Don't use the groupByDomain version of the page (it's not adjusted for mobile yet)
- Fix improper line breaks and formatting on blocked entries
- Show the "blocked visit" icon
- Hide the delete buttons

BUG=452859

Review URL: https://codereview.chromium.org/957253003

Cr-Commit-Position: refs/heads/master@{#318234}
parent 824907ba
......@@ -458,7 +458,6 @@ html[dir='rtl'] .blocked-indicator {
background-position-x: right;
}
<if expr="not is_android">
/* TODO(sergiu): If this is the final icon replace it with a separate resource.
*/
.entry .blocked-indicator {
......@@ -469,7 +468,6 @@ html[dir='rtl'] .blocked-indicator {
.blocked-indicator .title {
color: rgb(151, 156, 160);
}
</if>
.site-domain button:hover {
text-decoration: none;
......
......@@ -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';
......
......@@ -201,6 +201,10 @@ input {
line-height: 1.3;
}
.entry .visit-entry.blocked-indicator {
line-height: 2;
}
.entry .visit-entry :-webkit-any(a, .domain) {
display: block;
margin-left: 0;
......@@ -213,6 +217,10 @@ input {
white-space: nowrap;
}
.entry .visit-entry.blocked-indicator a {
display: inline;
}
.entry .domain {
font-size: 14px;
}
......
......@@ -191,10 +191,14 @@ content::WebUIDataSource* CreateHistoryUIHTMLSource(Profile* profile) {
source->AddLocalizedString("entrySummary", IDS_HISTORY_ENTRY_SUMMARY);
source->AddBoolean("isFullHistorySyncEnabled",
WebHistoryServiceFactory::GetForProfile(profile) != NULL);
source->AddBoolean("groupByDomain",
profile->IsSupervised() ||
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kHistoryEnableGroupByDomain));
bool group_by_domain = base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kHistoryEnableGroupByDomain);
// Supervised users get the "group by domain" version, but not on mobile,
// because that version isn't adjusted for small screens yet. crbug.com/452859
#if !defined(OS_ANDROID) && !defined(OS_IOS)
group_by_domain = group_by_domain || profile->IsSupervised();
#endif
source->AddBoolean("groupByDomain", group_by_domain);
bool allow_deleting_history =
prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory);
source->AddBoolean("allowDeletingHistory", allow_deleting_history);
......
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