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

Unified Diff: chrome/browser/resources/options/route_stub.js

Issue 2236213002: Add quick unlock Settings in options page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pre-process i18n in options and trim route_stub.js Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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,
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698