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

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

Issue 591353002: history: fix focus regression when showing "Remove history" confirmation dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 3 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/alert_overlay.html ('k') | chrome/test/data/webui/history_browsertest.js » ('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 0f285966adf808ef26d31ec336be8e2068b9b8bc..7756fa02a1ee28dd2425e26a429e096e318da351 100644
--- a/chrome/browser/resources/history/history.js
+++ b/chrome/browser/resources/history/history.js
@@ -1975,7 +1975,13 @@ function openClearBrowsingData(e) {
function showConfirmationOverlay() {
$('alertOverlay').classList.add('showing');
$('overlay').hidden = false;
+ $('history-page').setAttribute('aria-hidden', 'true');
uber.invokeMethodOnParent('beginInterceptingEvents');
+
+ // If an element is focused behind the confirm overlay, blur it so focus
+ // doesn't accidentally get stuck behind it.
+ if ($('history-page').contains(document.activeElement))
+ document.activeElement.blur();
}
/**
@@ -1984,6 +1990,7 @@ function showConfirmationOverlay() {
function hideConfirmationOverlay() {
$('alertOverlay').classList.remove('showing');
$('overlay').hidden = true;
+ $('history-page').removeAttribute('aria-hidden');
uber.invokeMethodOnParent('stopInterceptingEvents');
}
@@ -1999,10 +2006,10 @@ function confirmDeletion(okCallback, cancelCallback) {
alertOverlay.setValues(
loadTimeData.getString('removeSelected'),
loadTimeData.getString('deleteWarning'),
- loadTimeData.getString('cancel'),
loadTimeData.getString('deleteConfirm'),
- cancelCallback,
- okCallback);
+ loadTimeData.getString('cancel'),
+ okCallback,
+ cancelCallback);
showConfirmationOverlay();
}
« no previous file with comments | « chrome/browser/resources/history/alert_overlay.html ('k') | chrome/test/data/webui/history_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698