Chromium Code Reviews| 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 c12168e0609909b5956094c168351b9d2a1fa1f2..a9ee5acd8ae3484b77a5f866ed418ab1fd31c567 100644 |
| --- a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js |
| +++ b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js |
| @@ -46,10 +46,8 @@ Polymer({ |
| this.lightDomChanged_.bind(this)); |
| this.addEventListener('subpage-back', function() { |
| - assert(this.currentRoute.section == this.section); |
| - assert(this.currentRoute.subpage.length >= 1); |
| - |
| - this.setSubpageChain(this.currentRoute.subpage.slice(0, -1)); |
| + assert(this.currentRoute.parent != null); |
|
michaelpg
2016/07/20 19:48:23
why not assert in navigateTo instead of in individ
tommycli
2016/07/20 20:33:30
Done.
|
| + settings.navigateTo(this.currentRoute.parent); |
| }.bind(this)); |
| }, |
| @@ -141,24 +139,4 @@ Polymer({ |
| template.if = true; |
| template.render(); |
| }, |
| - |
| - /** |
| - * Buttons in this pageset should use this method to transition to subpages. |
| - * @param {!Array<string>} subpage The chain of subpages within the page. |
| - */ |
| - setSubpageChain: function(subpage) { |
| - var node = window.event.currentTarget; |
| - var page; |
| - while (node) { |
| - if (node.dataset && node.dataset.page) |
| - page = node.dataset.page; |
| - // A shadow root has a |host| rather than a |parentNode|. |
| - node = node.host || node.parentNode; |
| - } |
| - this.currentRoute = { |
| - page: page, |
| - section: subpage.length > 0 ? this.section : '', |
| - subpage: subpage, |
| - }; |
| - }, |
| }); |