| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-router' is a simple router for settings. Its responsibilites: | 7 * 'settings-router' is a simple router for settings. Its responsibilites: |
| 8 * - Update the URL when the routing state changes. | 8 * - Update the URL when the routing state changes. |
| 9 * - Initialize the routing state with the initial URL. | 9 * - Initialize the routing state with the initial URL. |
| 10 * - Process and validate all routing state changes. | 10 * - Process and validate all routing state changes. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 subpage: ['network-detail'], | 139 subpage: ['network-detail'], |
| 140 subpageTitles: ['internetDetailPageTitle'], | 140 subpageTitles: ['internetDetailPageTitle'], |
| 141 }, | 141 }, |
| 142 { | 142 { |
| 143 url: '/knownNetworks', | 143 url: '/knownNetworks', |
| 144 page: 'basic', | 144 page: 'basic', |
| 145 section: 'internet', | 145 section: 'internet', |
| 146 subpage: ['known-networks'], | 146 subpage: ['known-networks'], |
| 147 subpageTitles: ['internetKnownNetworksPageTitle'], | 147 subpageTitles: ['internetKnownNetworksPageTitle'], |
| 148 }, | 148 }, |
| 149 { |
| 150 url: '/languages', |
| 151 page: 'advanced', |
| 152 section: 'languages', |
| 153 subpage: ['manage-languages'], |
| 154 subpageTitles: ['manageLanguagesPageTitle'], |
| 155 }, |
| 149 ], | 156 ], |
| 150 | 157 |
| 151 /** | 158 /** |
| 152 * Sets up a history popstate observer. | 159 * Sets up a history popstate observer. |
| 153 */ | 160 */ |
| 154 created: function() { | 161 created: function() { |
| 155 window.addEventListener('popstate', function(event) { | 162 window.addEventListener('popstate', function(event) { |
| 156 if (event.state && event.state.page) | 163 if (event.state && event.state.page) |
| 157 this.currentRoute = event.state; | 164 this.currentRoute = event.state; |
| 158 }.bind(this)); | 165 }.bind(this)); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 history.replaceState(historicState, null); | 211 history.replaceState(historicState, null); |
| 205 } | 212 } |
| 206 | 213 |
| 207 return; | 214 return; |
| 208 } | 215 } |
| 209 } | 216 } |
| 210 | 217 |
| 211 assertNotReached('Route not found: ' + JSON.stringify(newRoute)); | 218 assertNotReached('Route not found: ' + JSON.stringify(newRoute)); |
| 212 }, | 219 }, |
| 213 }); | 220 }); |
| OLD | NEW |