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

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

Issue 2234093002: Settings Router Refactor: Update subpage-back button to use history back sometimes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix closure compile using typecast Created 4 years, 4 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_subpage.js
diff --git a/chrome/browser/resources/settings/settings_page/settings_subpage.js b/chrome/browser/resources/settings/settings_page/settings_subpage.js
index eaa4874cc6186bbd8346c75c05b5d40ba30e0ce2..e7b171a1cc96cfe37bdb379e6adc9fae39057587 100644
--- a/chrome/browser/resources/settings/settings_page/settings_subpage.js
+++ b/chrome/browser/resources/settings/settings_page/settings_subpage.js
@@ -43,7 +43,15 @@ Polymer({
/** @private */
onTapBack_: function() {
- settings.navigateTo(assert(settings.getCurrentRoute().parent));
+ var previousRoute =
+ window.history.state &&
+ assert(settings.getRouteForPath(
+ /** @type {string} */ (window.history.state)));
+
+ if (previousRoute && previousRoute.contains(settings.getCurrentRoute()))
+ window.history.back();
+ else
+ settings.navigateTo(assert(settings.getCurrentRoute().parent));
},
/** @private */
« no previous file with comments | « chrome/browser/resources/settings/route.js ('k') | chrome/test/data/webui/settings/cr_settings_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698