Chromium Code Reviews| Index: chrome/browser/resources/settings/people_page/quick_unlock_routing_behavior.js |
| diff --git a/chrome/browser/resources/settings/people_page/quick_unlock_routing_behavior.js b/chrome/browser/resources/settings/people_page/quick_unlock_routing_behavior.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7f5e23bdcf9aa30a565c5acd31560b383a250bc4 |
| --- /dev/null |
| +++ b/chrome/browser/resources/settings/people_page/quick_unlock_routing_behavior.js |
| @@ -0,0 +1,30 @@ |
| +// 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. |
| + |
| +/** @enum {string} */ |
| +var QuickUnlockScreen = { |
| + AUTHENTICATE: 'quick-unlock-authenticate', |
| + CHOOSE_METHOD: 'quick-unlock-choose-method', |
| + SETUP_PIN: 'quick-unlock-setup-pin' |
| +}; |
| + |
| +/** @polymerBehavior */ |
| +var QuickUnlockRoutingBehavior = { |
|
tommycli
2016/06/29 21:04:23
Okay this is fine for now. We might be able to eli
jdufault
2016/06/29 22:02:04
sg, it'd be nice to move this method (or something
|
| + properties: { |
| + currentRoute: { |
| + type: Object, |
| + notify: true, |
| + } |
| + }, |
| + |
| + /** |
| + * Returns true if the given screen is active. |
| + * @param {!QuickUnlockScreen} screen |
| + * @return {!boolean} |
| + */ |
| + isScreenActive: function(screen) { |
| + var subpage = this.currentRoute.subpage; |
| + return subpage.length > 0 && subpage[subpage.length - 1] == screen; |
| + }, |
| +}; |