| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // TODO(xiaoyinh@): This file is a stub class of |
| 6 // chrome/browser/resources/settings/route.js. And it is used to integrate |
| 7 // with the polymer elements in settings. |
| 8 // It should be removed once we don't need to support options. |
| 9 |
| 10 cr.define('settings', function() { |
| 11 /** |
| 12 * Class for navigable routes. May only be instantiated within this file. |
| 13 * @constructor |
| 14 * @param {string} path |
| 15 * @private |
| 16 */ |
| 17 var Route = function(path) { |
| 18 this.path = path; |
| 19 }; |
| 20 |
| 21 // Abbreviated variable for easier definitions. |
| 22 var r = Route; |
| 23 |
| 24 // Root pages. |
| 25 r.BASIC = new Route('/'); |
| 26 r.PEOPLE = r.BASIC; |
| 27 r.LOCK_SCREEN = new Route('/quickUnlockConfigureOverlay'); |
| 28 |
| 29 /** @polymerBehavior */ |
| 30 var RouteObserverBehavior = {}; |
| 31 |
| 32 var currentRoute_ = Route.BASIC; |
| 33 |
| 34 var getCurrentRoute = function() { return currentRoute_; }; |
| 35 |
| 36 var navigateTo = function(route) { |
| 37 currentRoute_ = route; |
| 38 if ($('lock-screen')) { |
| 39 $('lock-screen').currentRouteChanged(); |
| 40 } |
| 41 }; |
| 42 |
| 43 return { |
| 44 Route: Route, |
| 45 RouteObserverBehavior: RouteObserverBehavior, |
| 46 getCurrentRoute: getCurrentRoute, |
| 47 navigateTo: navigateTo, |
| 48 }; |
| 49 }); |
| OLD | NEW |