| Index: chrome/browser/resources/options/route_stub.js
|
| diff --git a/chrome/browser/resources/options/route_stub.js b/chrome/browser/resources/options/route_stub.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a3c87fe9893817055a02a44e5e5a65df0e73e515
|
| --- /dev/null
|
| +++ b/chrome/browser/resources/options/route_stub.js
|
| @@ -0,0 +1,49 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +//
|
| +// TODO(xiaoyinh@): This file is a stub class of
|
| +// chrome/browser/resources/settings/route.js. And it is used to integrate
|
| +// with the polymer elements in settings.
|
| +// It should be removed once we don't need to support options.
|
| +
|
| +cr.define('settings', function() {
|
| + /**
|
| + * Class for navigable routes. May only be instantiated within this file.
|
| + * @constructor
|
| + * @param {string} path
|
| + * @private
|
| + */
|
| + var Route = function(path) {
|
| + this.path = path;
|
| + };
|
| +
|
| + // Abbreviated variable for easier definitions.
|
| + var r = Route;
|
| +
|
| + // Root pages.
|
| + r.BASIC = new Route('/');
|
| + r.PEOPLE = r.BASIC;
|
| + r.LOCK_SCREEN = new Route('/quickUnlockConfigureOverlay');
|
| +
|
| + /** @polymerBehavior */
|
| + var RouteObserverBehavior = {};
|
| +
|
| + var currentRoute_ = Route.BASIC;
|
| +
|
| + var getCurrentRoute = function() { return currentRoute_; };
|
| +
|
| + var navigateTo = function(route) {
|
| + currentRoute_ = route;
|
| + if ($('lock-screen')) {
|
| + $('lock-screen').currentRouteChanged();
|
| + }
|
| + };
|
| +
|
| + return {
|
| + Route: Route,
|
| + RouteObserverBehavior: RouteObserverBehavior,
|
| + getCurrentRoute: getCurrentRoute,
|
| + navigateTo: navigateTo,
|
| + };
|
| +});
|
|
|