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

Side by Side Diff: chrome/browser/resources/settings/settings_page/settings_router.js

Issue 2106103006: MD Settings: cr/cros - Guest mode page visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 5 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 unified diff | Download patch
OLDNEW
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 * @typedef {{ 6 * @typedef {{
7 * dialog: (string|undefined), 7 * dialog: (string|undefined),
8 * page: string, 8 * page: string,
9 * section: string, 9 * section: string,
10 * subpage: !Array<string>, 10 * subpage: !Array<string>,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 notify: true, 84 notify: true,
85 type: Object, 85 type: Object,
86 value: function() { 86 value: function() {
87 return { 87 return {
88 pageTitle: '', 88 pageTitle: '',
89 }; 89 };
90 }, 90 },
91 }, 91 },
92 }, 92 },
93 93
94
95 /** 94 /**
96 * @private {!Array<!CanonicalRoute>} 95 * @private {!Array<!CanonicalRoute>}
97 * The 'url' property is not accessible to other elements. 96 * The 'url' property is not accessible to other elements.
98 */ 97 */
99 canonicalRoutes_: [ 98 canonicalRoutes_: [],
tommycli 2016/07/14 22:55:39 I hate to do this to you Moe, but I'm not a big fa
Moe 2016/07/15 14:02:07 That's correct. Basically, in guest mode, some rou
100 {
101 url: '/',
102 page: 'basic',
103 section: '',
104 subpage: [],
105 },
106 {
107 url: '/help',
108 page: 'about',
109 section: '',
110 subpage: [],
111 },
112 <if expr="chromeos">
113 {
114 url: '/help/details',
115 page: 'about',
116 section: 'about',
117 subpage: ['detailed-build-info'],
118 },
119 </if>
120 {
121 url: '/advanced',
122 page: 'advanced',
123 section: '',
124 subpage: [],
125 },
126 <if expr="chromeos">
127 {
128 url: '/internet',
129 page: 'basic',
130 section: 'internet',
131 subpage: [],
132 },
133 {
134 url: '/networkDetail',
135 page: 'basic',
136 section: 'internet',
137 subpage: ['network-detail'],
138 },
139 {
140 url: '/knownNetworks',
141 page: 'basic',
142 section: 'internet',
143 subpage: ['known-networks'],
144 },
145 </if>
146 {
147 url: '/appearance',
148 page: 'basic',
149 section: 'appearance',
150 subpage: [],
151 },
152 {
153 url: '/fonts',
154 page: 'basic',
155 section: 'appearance',
156 subpage: ['appearance-fonts'],
157 },
158 {
159 url: '/defaultBrowser',
160 page: 'basic',
161 section: 'defaultBrowser',
162 subpage: [],
163 },
164 {
165 url: '/search',
166 page: 'basic',
167 section: 'search',
168 subpage: [],
169 },
170 {
171 url: '/searchEngines',
172 page: 'basic',
173 section: 'search',
174 subpage: ['search-engines'],
175 },
176 {
177 url: '/onStartup',
178 page: 'basic',
179 section: 'onStartup',
180 subpage: [],
181 },
182 {
183 url: '/people',
184 page: 'basic',
185 section: 'people',
186 subpage: [],
187 },
188 <if expr="chromeos">
189 {
190 url: '/changePicture',
191 page: 'basic',
192 section: 'people',
193 subpage: ['changePicture'],
194 },
195 </if>
196 <if expr="not chromeos">
197 {
198 url: '/manageProfile',
199 page: 'basic',
200 section: 'people',
201 subpage: ['manageProfile'],
202 },
203 </if>
204 {
205 url: '/syncSetup',
206 page: 'basic',
207 section: 'people',
208 subpage: ['sync'],
209 },
210 <if expr="chromeos">
211 {
212 url: '/quickUnlock/authenticate',
213 page: 'basic',
214 section: 'people',
215 subpage: ['quick-unlock-authenticate'],
216 },
217 {
218 url: '/quickUnlock/chooseMethod',
219 page: 'basic',
220 section: 'people',
221 subpage: ['quick-unlock-choose-method'],
222 },
223 {
224 url: '/quickUnlock/setupPin',
225 page: 'basic',
226 section: 'people',
227 subpage: ['quick-unlock-choose-method', 'quick-unlock-setup-pin'],
228 },
229 {
230 url: '/accounts',
231 page: 'basic',
232 section: 'people',
233 subpage: ['users'],
234 },
235 </if>
236 {
237 url: '/privacy',
238 page: 'advanced',
239 section: 'privacy',
240 subpage: [],
241 },
242 {
243 url: '/certificates',
244 page: 'advanced',
245 section: 'privacy',
246 subpage: ['manage-certificates'],
247 },
248 {
249 url: '/siteSettings',
250 page: 'advanced',
251 section: 'privacy',
252 subpage: ['site-settings'],
253 },
254 // Site Category routes.
255 {
256 url: '/siteSettings/all',
257 page: 'advanced',
258 section: 'privacy',
259 subpage: ['site-settings', 'all-sites'],
260 },
261 {
262 url: '/siteSettings/automaticDownloads',
263 page: 'advanced',
264 section: 'privacy',
265 subpage: ['site-settings', 'site-settings-category-automatic-downloads'],
266 },
267 {
268 url: '/siteSettings/backgroundSync',
269 page: 'advanced',
270 section: 'privacy',
271 subpage: ['site-settings', 'site-settings-category-background-sync'],
272 },
273 {
274 url: '/siteSettings/camera',
275 page: 'advanced',
276 section: 'privacy',
277 subpage: ['site-settings', 'site-settings-category-camera'],
278 },
279 {
280 url: '/siteSettings/cookies',
281 page: 'advanced',
282 section: 'privacy',
283 subpage: ['site-settings', 'site-settings-category-cookies'],
284 },
285 {
286 url: '/siteSettings/fullscreen',
287 page: 'advanced',
288 section: 'privacy',
289 subpage: ['site-settings', 'site-settings-category-fullscreen'],
290 },
291 {
292 url: '/siteSettings/images',
293 page: 'advanced',
294 section: 'privacy',
295 subpage: ['site-settings', 'site-settings-category-images'],
296 },
297 {
298 url: '/siteSettings/handlers',
299 page: 'advanced',
300 section: 'privacy',
301 subpage: ['site-settings', 'protocol-handlers'],
302 },
303 {
304 url: '/siteSettings/javascript',
305 page: 'advanced',
306 section: 'privacy',
307 subpage: ['site-settings', 'site-settings-category-javascript'],
308 },
309 {
310 url: '/siteSettings/keygen',
311 page: 'advanced',
312 section: 'privacy',
313 subpage: ['site-settings', 'site-settings-category-keygen'],
314 },
315 {
316 url: '/siteSettings/location',
317 page: 'advanced',
318 section: 'privacy',
319 subpage: ['site-settings', 'site-settings-category-location'],
320 },
321 {
322 url: '/siteSettings/microphone',
323 page: 'advanced',
324 section: 'privacy',
325 subpage: ['site-settings', 'site-settings-category-microphone'],
326 },
327 {
328 url: '/siteSettings/notifications',
329 page: 'advanced',
330 section: 'privacy',
331 subpage: ['site-settings', 'site-settings-category-notifications'],
332 },
333 {
334 url: '/siteSettings/plugins',
335 page: 'advanced',
336 section: 'privacy',
337 subpage: ['site-settings', 'site-settings-category-plugins'],
338 },
339 {
340 url: '/siteSettings/popups',
341 page: 'advanced',
342 section: 'privacy',
343 subpage: ['site-settings', 'site-settings-category-popups'],
344 },
345 {
346 url: '/siteSettings/unsandboxedPlugins',
347 page: 'advanced',
348 section: 'privacy',
349 subpage: ['site-settings', 'site-settings-category-unsandboxed-plugins'],
350 },
351 // Site details routes.
352 {
353 url: '/siteSettings/all/details',
354 page: 'advanced',
355 section: 'privacy',
356 subpage: ['site-settings', 'all-sites', 'site-details'],
357 },
358 {
359 url: '/siteSettings/automaticDownloads/details',
360 page: 'advanced',
361 section: 'privacy',
362 subpage: ['site-settings', 'site-settings-category-automatic-downloads',
363 'site-details'],
364 },
365 {
366 url: '/siteSettings/backgroundSync/details',
367 page: 'advanced',
368 section: 'privacy',
369 subpage: ['site-settings', 'site-settings-category-background-sync',
370 'site-details'],
371 },
372 {
373 url: '/siteSettings/camera/details',
374 page: 'advanced',
375 section: 'privacy',
376 subpage: ['site-settings', 'site-settings-category-camera',
377 'site-details'],
378 },
379 {
380 url: '/siteSettings/cookies/details',
381 page: 'advanced',
382 section: 'privacy',
383 subpage: ['site-settings', 'site-settings-category-cookies',
384 'site-details'],
385 },
386 {
387 url: '/siteSettings/fullscreen/details',
388 page: 'advanced',
389 section: 'privacy',
390 subpage: ['site-settings', 'site-settings-category-fullscreen',
391 'site-details'],
392 },
393 {
394 url: '/siteSettings/images/details',
395 page: 'advanced',
396 section: 'privacy',
397 subpage: ['site-settings', 'site-settings-category-images',
398 'site-details'],
399 },
400 {
401 url: '/siteSettings/javascript/details',
402 page: 'advanced',
403 section: 'privacy',
404 subpage: ['site-settings', 'site-settings-category-javascript',
405 'site-details'],
406 },
407 {
408 url: '/siteSettings/keygen/details',
409 page: 'advanced',
410 section: 'privacy',
411 subpage: ['site-settings', 'site-settings-category-keygen',
412 'site-details'],
413 },
414 {
415 url: '/siteSettings/location/details',
416 page: 'advanced',
417 section: 'privacy',
418 subpage: ['site-settings', 'site-settings-category-location',
419 'site-details'],
420 },
421 {
422 url: '/siteSettings/microphone/details',
423 page: 'advanced',
424 section: 'privacy',
425 subpage: ['site-settings', 'site-settings-category-microphone',
426 'site-details'],
427 },
428 {
429 url: '/siteSettings/notifications/details',
430 page: 'advanced',
431 section: 'privacy',
432 subpage: ['site-settings', 'site-settings-category-notifications',
433 'site-details'],
434 },
435 {
436 url: '/siteSettings/plugins/details',
437 page: 'advanced',
438 section: 'privacy',
439 subpage: ['site-settings', 'site-settings-category-plugins',
440 'site-details'],
441 },
442 {
443 url: '/siteSettings/popups/details',
444 page: 'advanced',
445 section: 'privacy',
446 subpage: ['site-settings', 'site-settings-category-popups',
447 'site-details'],
448 },
449 {
450 url: '/siteSettings/unsandboxedPlugins/details',
451 page: 'advanced',
452 section: 'privacy',
453 subpage: ['site-settings', 'site-settings-category-unsandsboxed-plugins',
454 'site-details'],
455 },
456 {
457 url: '/clearBrowserData',
458 page: 'advanced',
459 section: 'privacy',
460 subpage: [],
461 dialog: 'clear-browsing-data',
462 },
463 <if expr="chromeos">
464 {
465 url: '/dateTime',
466 page: 'advanced',
467 section: 'dateTime',
468 subpage: [],
469 },
470 {
471 url: '/bluetooth',
472 page: 'advanced',
473 section: 'bluetooth',
474 subpage: [],
475 },
476 {
477 url: '/bluetoothAddDevice',
478 page: 'advanced',
479 section: 'bluetooth',
480 subpage: ['bluetooth-add-device'],
481 },
482 {
483 url: '/bluetoothAddDevice/bluetoothPairDevice',
484 page: 'advanced',
485 section: 'bluetooth',
486 subpage: ['bluetooth-add-device', 'bluetooth-pair-device'],
487 },
488 </if>
489 {
490 url: '/autofill',
491 page: 'advanced',
492 section: 'passwordsAndForms',
493 subpage: ['manage-autofill'],
494 },
495 {
496 url: '/passwords',
497 page: 'advanced',
498 section: 'passwordsAndForms',
499 subpage: [],
500 },
501 {
502 url: '/managePasswords',
503 page: 'advanced',
504 section: 'passwordsAndForms',
505 subpage: ['manage-passwords'],
506 },
507 {
508 url: '/languages',
509 page: 'advanced',
510 section: 'languages',
511 subpage: [],
512 },
513 {
514 url: '/manageLanguages',
515 page: 'advanced',
516 section: 'languages',
517 subpage: ['manage-languages'],
518 },
519 {
520 url: '/languages/edit',
521 page: 'advanced',
522 section: 'languages',
523 subpage: ['language-detail'],
524 },
525 <if expr="chromeos">
526 {
527 url: '/inputMethods',
528 page: 'advanced',
529 section: 'languages',
530 subpage: ['manage-input-methods'],
531 },
532 </if>
533 <if expr="not is_macosx">
534 {
535 url: '/editDictionary',
536 page: 'advanced',
537 section: 'languages',
538 subpage: ['edit-dictionary'],
539 },
540 </if>
541 {
542 url: '/downloadsDirectory',
543 page: 'advanced',
544 section: 'downloads',
545 subpage: [],
546 },
547 {
548 url: '/printing',
549 page: 'advanced',
550 section: 'printing',
551 subpage: [],
552 },
553 {
554 url: '/accessibility',
555 page: 'advanced',
556 section: 'a11y',
557 subpage: [],
558 },
559 {
560 url: '/system',
561 page: 'advanced',
562 section: 'system',
563 subpage: [],
564 },
565 {
566 url: '/reset',
567 page: 'advanced',
568 section: 'reset',
569 subpage: [],
570 },
571 <if expr="chromeos">
572 {
573 url: '/device',
574 page: 'basic',
575 section: 'device',
576 subpage: [],
577 },
578 {
579 url: '/pointer-overlay',
580 page: 'basic',
581 section: 'device',
582 subpage: ['touchpad'],
583 },
584 {
585 url: '/keyboard-overlay',
586 page: 'basic',
587 section: 'device',
588 subpage: ['keyboard'],
589 },
590 {
591 url: '/display',
592 page: 'basic',
593 section: 'device',
594 subpage: ['display'],
595 },
596 </if>
597 ],
598 99
599 /** 100 /**
600 * Sets up a history popstate observer. 101 * Sets up a history popstate observer.
601 */ 102 */
602 created: function() { 103 created: function() {
603 window.addEventListener('popstate', function(event) { 104 window.addEventListener('popstate', function(event) {
604 if (event.state && event.state.page) 105 if (event.state && event.state.page)
605 this.currentRoute = event.state; 106 this.currentRoute = event.state;
606 }.bind(this)); 107 }.bind(this));
108
109 var searchRoutes = [
110 {
111 url: '/search',
112 page: 'basic',
113 section: 'search',
114 subpage: [],
115 },
116 ];
117
118 var advancedRoutes = [
119 {
120 url: '/advanced',
121 page: 'advanced',
122 section: '',
123 subpage: [],
124 },
125 ];
126
127 <if expr="chromeos">
128 var internetRoutes = [
129 {
130 url: '/internet',
131 page: 'basic',
132 section: 'internet',
133 subpage: [],
134 },
135 {
136 url: '/networkDetail',
137 page: 'basic',
138 section: 'internet',
139 subpage: ['network-detail'],
140 },
141 {
142 url: '/knownNetworks',
143 page: 'basic',
144 section: 'internet',
145 subpage: ['known-networks'],
146 },
147 ];
148
149 var deviceRoutes = [
150 {
151 url: '/device',
152 page: 'basic',
153 section: 'device',
154 subpage: [],
155 },
156 {
157 url: '/pointer-overlay',
158 page: 'basic',
159 section: 'device',
160 subpage: ['touchpad'],
161 },
162 {
163 url: '/keyboard-overlay',
164 page: 'basic',
165 section: 'device',
166 subpage: ['keyboard'],
167 },
168 {
169 url: '/display',
170 page: 'basic',
171 section: 'device',
172 subpage: ['display'],
173 },
174 ];
175
176 var bluetoothRoutes = [
177 {
178 url: '/bluetooth',
179 page: 'advanced',
180 section: 'bluetooth',
181 subpage: [],
182 },
183 {
184 url: '/bluetoothAddDevice',
185 page: 'advanced',
186 section: 'bluetooth',
187 subpage: ['bluetooth-add-device'],
188 },
189 {
190 url: '/bluetoothAddDevice/bluetoothPairDevice',
191 page: 'advanced',
192 section: 'bluetooth',
193 subpage: ['bluetooth-add-device', 'bluetooth-pair-device'],
194 },
195 ]
196 </if>
197
198 var appearanceRoutes = [
199 {
200 url: '/appearance',
201 page: 'basic',
202 section: 'appearance',
203 subpage: [],
204 },
205 {
206 url: '/fonts',
207 page: 'basic',
208 section: 'appearance',
209 subpage: ['appearance-fonts'],
210 },
211 ];
212
213 var dateTimeRoutes = [
214 {
215 url: '/dateTime',
216 page: 'advanced',
217 section: 'dateTime',
218 subpage: [],
219 },
220 ];
221
222 var privacyRoutes = [
223 {
224 url: '/privacy',
225 page: 'advanced',
226 section: 'privacy',
227 subpage: [],
228 },
229 {
230 url: '/certificates',
231 page: 'advanced',
232 section: 'privacy',
233 subpage: ['manage-certificates'],
234 },
235 {
236 url: '/siteSettings',
237 page: 'advanced',
238 section: 'privacy',
239 subpage: ['site-settings'],
240 },
241 // Site Category routes.
242 {
243 url: '/siteSettings/all',
244 page: 'advanced',
245 section: 'privacy',
246 subpage: ['site-settings', 'all-sites'],
247 },
248 {
249 url: '/siteSettings/automaticDownloads',
250 page: 'advanced',
251 section: 'privacy',
252 subpage: ['site-settings',
253 'site-settings-category-automatic-downloads'],
254 },
255 {
256 url: '/siteSettings/backgroundSync',
257 page: 'advanced',
258 section: 'privacy',
259 subpage: ['site-settings', 'site-settings-category-background-sync'],
260 },
261 {
262 url: '/siteSettings/camera',
263 page: 'advanced',
264 section: 'privacy',
265 subpage: ['site-settings', 'site-settings-category-camera'],
266 },
267 {
268 url: '/siteSettings/cookies',
269 page: 'advanced',
270 section: 'privacy',
271 subpage: ['site-settings', 'site-settings-category-cookies'],
272 },
273 {
274 url: '/siteSettings/fullscreen',
275 page: 'advanced',
276 section: 'privacy',
277 subpage: ['site-settings', 'site-settings-category-fullscreen'],
278 },
279 {
280 url: '/siteSettings/images',
281 page: 'advanced',
282 section: 'privacy',
283 subpage: ['site-settings', 'site-settings-category-images'],
284 },
285 {
286 url: '/siteSettings/handlers',
287 page: 'advanced',
288 section: 'privacy',
289 subpage: ['site-settings', 'protocol-handlers'],
290 },
291 {
292 url: '/siteSettings/javascript',
293 page: 'advanced',
294 section: 'privacy',
295 subpage: ['site-settings', 'site-settings-category-javascript'],
296 },
297 {
298 url: '/siteSettings/keygen',
299 page: 'advanced',
300 section: 'privacy',
301 subpage: ['site-settings', 'site-settings-category-keygen'],
302 },
303 {
304 url: '/siteSettings/location',
305 page: 'advanced',
306 section: 'privacy',
307 subpage: ['site-settings', 'site-settings-category-location'],
308 },
309 {
310 url: '/siteSettings/microphone',
311 page: 'advanced',
312 section: 'privacy',
313 subpage: ['site-settings', 'site-settings-category-microphone'],
314 },
315 {
316 url: '/siteSettings/notifications',
317 page: 'advanced',
318 section: 'privacy',
319 subpage: ['site-settings', 'site-settings-category-notifications'],
320 },
321 {
322 url: '/siteSettings/plugins',
323 page: 'advanced',
324 section: 'privacy',
325 subpage: ['site-settings', 'site-settings-category-plugins'],
326 },
327 {
328 url: '/siteSettings/popups',
329 page: 'advanced',
330 section: 'privacy',
331 subpage: ['site-settings', 'site-settings-category-popups'],
332 },
333 {
334 url: '/siteSettings/unsandboxedPlugins',
335 page: 'advanced',
336 section: 'privacy',
337 subpage: ['site-settings',
338 'site-settings-category-unsandboxed-plugins'],
339 },
340 // Site details routes.
341 {
342 url: '/siteSettings/all/details',
343 page: 'advanced',
344 section: 'privacy',
345 subpage: ['site-settings', 'all-sites', 'site-details'],
346 },
347 {
348 url: '/siteSettings/automaticDownloads/details',
349 page: 'advanced',
350 section: 'privacy',
351 subpage: ['site-settings', 'site-settings-category-automatic-downloads',
352 'site-details'],
353 },
354 {
355 url: '/siteSettings/backgroundSync/details',
356 page: 'advanced',
357 section: 'privacy',
358 subpage: ['site-settings', 'site-settings-category-background-sync',
359 'site-details'],
360 },
361 {
362 url: '/siteSettings/camera/details',
363 page: 'advanced',
364 section: 'privacy',
365 subpage: ['site-settings', 'site-settings-category-camera',
366 'site-details'],
367 },
368 {
369 url: '/siteSettings/cookies/details',
370 page: 'advanced',
371 section: 'privacy',
372 subpage: ['site-settings', 'site-settings-category-cookies',
373 'site-details'],
374 },
375 {
376 url: '/siteSettings/fullscreen/details',
377 page: 'advanced',
378 section: 'privacy',
379 subpage: ['site-settings', 'site-settings-category-fullscreen',
380 'site-details'],
381 },
382 {
383 url: '/siteSettings/images/details',
384 page: 'advanced',
385 section: 'privacy',
386 subpage: ['site-settings', 'site-settings-category-images',
387 'site-details'],
388 },
389 {
390 url: '/siteSettings/javascript/details',
391 page: 'advanced',
392 section: 'privacy',
393 subpage: ['site-settings', 'site-settings-category-javascript',
394 'site-details'],
395 },
396 {
397 url: '/siteSettings/keygen/details',
398 page: 'advanced',
399 section: 'privacy',
400 subpage: ['site-settings', 'site-settings-category-keygen',
401 'site-details'],
402 },
403 {
404 url: '/siteSettings/location/details',
405 page: 'advanced',
406 section: 'privacy',
407 subpage: ['site-settings', 'site-settings-category-location',
408 'site-details'],
409 },
410 {
411 url: '/siteSettings/microphone/details',
412 page: 'advanced',
413 section: 'privacy',
414 subpage: ['site-settings', 'site-settings-category-microphone',
415 'site-details'],
416 },
417 {
418 url: '/siteSettings/notifications/details',
419 page: 'advanced',
420 section: 'privacy',
421 subpage: ['site-settings', 'site-settings-category-notifications',
422 'site-details'],
423 },
424 {
425 url: '/siteSettings/plugins/details',
426 page: 'advanced',
427 section: 'privacy',
428 subpage: ['site-settings', 'site-settings-category-plugins',
429 'site-details'],
430 },
431 {
432 url: '/siteSettings/popups/details',
433 page: 'advanced',
434 section: 'privacy',
435 subpage: ['site-settings', 'site-settings-category-popups',
436 'site-details'],
437 },
438 {
439 url: '/siteSettings/unsandboxedPlugins/details',
440 page: 'advanced',
441 section: 'privacy',
442 subpage: ['site-settings',
443 'site-settings-category-unsandsboxed-plugins',
444 'site-details'],
445 },
446 {
447 url: '/clearBrowserData',
448 page: 'advanced',
449 section: 'privacy',
450 subpage: [],
451 dialog: 'clear-browsing-data',
452 },
453 ];
454
455 var languagesRoutes = [
456 {
457 url: '/languages',
458 page: 'advanced',
459 section: 'languages',
460 subpage: [],
461 },
462 {
463 url: '/manageLanguages',
464 page: 'advanced',
465 section: 'languages',
466 subpage: ['manage-languages'],
467 },
468 {
469 url: '/languages/edit',
470 page: 'advanced',
471 section: 'languages',
472 subpage: ['language-detail'],
473 },
474 <if expr="chromeos">
475 {
476 url: '/inputMethods',
477 page: 'advanced',
478 section: 'languages',
479 subpage: ['manage-input-methods'],
480 },
481 </if>
482 <if expr="not chromeos and not is_macosx">
483 {
484 url: '/editDictionary',
485 page: 'advanced',
486 section: 'languages',
487 subpage: ['edit-dictionary'],
488 },
489 </if>
490 ];
491
492 var a11yRoutes = [
493 {
494 url: '/accessibility',
495 page: 'advanced',
496 section: 'a11y',
497 subpage: [],
498 },
499 ];
500
501 var printingRoutes = [
502 {
503 url: '/printing',
504 page: 'advanced',
505 section: 'printing',
506 subpage: [],
507 },
508 ];
509
510 var downloadRoutes = [
511 {
512 url: '/downloadsDirectory',
513 page: 'advanced',
514 section: 'downloads',
515 subpage: [],
516 },
517 ];
518
519 this.canonicalRoutes_ = [].concat(
520 <if expr="chromeos">
521 {
522 url: '/help/details',
523 page: 'about',
524 section: 'about',
525 subpage: ['detailed-build-info'],
526 },
527 a11yRoutes,
528 advancedRoutes,
529 appearanceRoutes,
530 bluetoothRoutes,
531 dateTimeRoutes,
532 deviceRoutes,
533 downloadRoutes,
534 internetRoutes,
535 languagesRoutes,
536 printingRoutes,
537 privacyRoutes,
538 searchRoutes,
539 </if>
540 {
541 url: '/',
542 page: 'basic',
543 section: '',
544 subpage: [],
545 },
546 {
547 url: '/searchEngines',
548 page: 'basic',
549 section: 'search',
550 subpage: ['search-engines'],
551 },
552 {
553 url: '/help',
554 page: 'about',
555 section: '',
556 subpage: [],
557 }
558 );
559
560 // Do not add the following routes if the user is a Guest user.
561 if (loadTimeData.getBoolean('isGuest'))
562 return;
563
564 this.canonicalRoutes_ = this.canonicalRoutes_.concat(
565 <if expr="not chromeos">
566 {
567 url: '/defaultBrowser',
568 page: 'basic',
569 section: 'defaultBrowser',
570 subpage: [],
571 },
572 {
573 url: '/manageProfile',
574 page: 'basic',
575 section: 'people',
576 subpage: ['manageProfile'],
577 },
578 {
579 url: '/system',
580 page: 'advanced',
581 section: 'system',
582 subpage: [],
583 },
584 a11yRoutes,
585 advancedRoutes,
586 appearanceRoutes,
587 dateTimeRoutes,
588 downloadRoutes,
589 languagesRoutes,
590 printingRoutes,
591 privacyRoutes,
592 searchRoutes,
593 </if>
594 <if expr="chromeos">
595 {
596 url: '/changePicture',
597 page: 'basic',
598 section: 'people',
599 subpage: ['changePicture'],
600 },
601 {
602 url: '/quickUnlock/authenticate',
603 page: 'basic',
604 section: 'people',
605 subpage: ['quick-unlock-authenticate'],
606 },
607 {
608 url: '/quickUnlock/chooseMethod',
609 page: 'basic',
610 section: 'people',
611 subpage: ['quick-unlock-choose-method'],
612 },
613 {
614 url: '/quickUnlock/setupPin',
615 page: 'basic',
616 section: 'people',
617 subpage: ['quick-unlock-choose-method', 'quick-unlock-setup-pin'],
618 },
619 {
620 url: '/accounts',
621 page: 'basic',
622 section: 'people',
623 subpage: ['users'],
624 },
625 </if>
626 {
627 url: '/onStartup',
628 page: 'basic',
629 section: 'onStartup',
630 subpage: [],
631 },
632 {
633 url: '/people',
634 page: 'basic',
635 section: 'people',
636 subpage: [],
637 },
638 {
639 url: '/syncSetup',
640 page: 'basic',
641 section: 'people',
642 subpage: ['sync'],
643 },
644 {
645 url: '/autofill',
646 page: 'advanced',
647 section: 'passwordsAndForms',
648 subpage: ['manage-autofill'],
649 },
650 {
651 url: '/passwords',
652 page: 'advanced',
653 section: 'passwordsAndForms',
654 subpage: [],
655 },
656 {
657 url: '/managePasswords',
658 page: 'advanced',
659 section: 'passwordsAndForms',
660 subpage: ['manage-passwords'],
661 },
662 {
663 url: '/reset',
664 page: 'advanced',
665 section: 'reset',
666 subpage: [],
667 }
668 );
607 }, 669 },
608 670
609 /** 671 /**
610 * Is called when another element modifies the route. This observer validates 672 * Is called when another element modifies the route. This observer validates
611 * the route change against the pre-defined list of routes, and updates the 673 * the route change against the pre-defined list of routes, and updates the
612 * URL appropriately. 674 * URL appropriately.
613 * @param {!SettingsRoute} newRoute Where we're headed. 675 * @param {!SettingsRoute} newRoute Where we're headed.
614 * @param {!SettingsRoute|undefined} oldRoute Where we've been. 676 * @param {!SettingsRoute|undefined} oldRoute Where we've been.
615 * @private 677 * @private
616 */ 678 */
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 window.history.replaceState(historicRoute, document.title); 716 window.history.replaceState(historicRoute, document.title);
655 } 717 }
656 718
657 return; 719 return;
658 } 720 }
659 } 721 }
660 722
661 assertNotReached('Route not found: ' + JSON.stringify(newRoute)); 723 assertNotReached('Route not found: ' + JSON.stringify(newRoute));
662 }, 724 },
663 }); 725 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698