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

Unified Diff: chrome/browser/resources/settings/settings_page/settings_animated_pages.js

Issue 2817903004: MD Settings: Focus cookies search field when exiting cookie details subpage. (Closed)
Patch Set: Simulate pop state in test. Created 3 years, 8 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/resources/settings/settings_page/settings_animated_pages.js
diff --git a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
index 5e71132eaeeb62bccc4400fac8a1525c3131bca1..3da7e7a3771d95773f3b294bd853e65a5d137363 100644
--- a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
+++ b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
@@ -59,10 +59,18 @@ Polymer({
if (!this.focusConfig || !this.previousRoute_)
return;
+ // Don't attempt to focus any anchor element, unless last navigation was a
+ // 'pop' (backwards) navigation.
+ if (!settings.lastRouteChangeWasPopstate())
+ return;
+
// Only handle iron-select events from neon-animatable elements and the
- // SITE_SETTINGS subpage only.
+ // given whitelist of settings-subpage instances.
if (!e.detail.item.matches(
- 'neon-animatable, settings-subpage#site-settings')) {
+ 'neon-animatable, ' +
+ 'settings-subpage#site-settings, ' +
+ 'settings-subpage[route-path=\"' +
+ settings.Route.SITE_SETTINGS_COOKIES.path + '\"]')) {
return;
}

Powered by Google App Engine
This is Rietveld 408576698