Index: chrome/browser/resources/settings/people_page/quick_unlock_password_detect_behavior.js |
diff --git a/chrome/browser/resources/settings/people_page/quick_unlock_password_detect_behavior.js b/chrome/browser/resources/settings/people_page/quick_unlock_password_detect_behavior.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3b67d36a6a5c0e152b5e0d45eb0cb66aa9d4ed83 |
--- /dev/null |
+++ b/chrome/browser/resources/settings/people_page/quick_unlock_password_detect_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. |
+ |
+/** |
+ * @fileoverview |
+ * Contains utilities for verifying the user has entered an account password. |
+ */ |
+ |
+/** @polymerBehavior */ |
+var QuickUnlockPasswordDetectBehavior = [QuickUnlockRoutingBehavior, { |
+ properties: { |
+ setModes: Object |
+ }, |
+ |
+ /** |
+ * Verifies that there is an account password available for the |
+ * chrome.quickUnlockPrivate.setModes call. If there is no password, this will |
+ * redirect to the authenticate screen. |
+ */ |
+ askForPasswordIfUnset: function() { |
+ if (!this.setModes) { |
+ this.currentRoute = { |
+ page: 'basic', |
+ section: 'people', |
+ subpage: [QuickUnlockScreen.AUTHENTICATE] |
+ }; |
+ } |
+ } |
+}]; |