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

Side by Side Diff: chrome/browser/resources/settings/people_page/lock_screen.js

Issue 2973243002: Adding pref to store the user-selected proximity threshold. (Closed)
Patch Set: Addressing DEPS issues Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-lock-screen' allows the user to change how they unlock their 7 * 'settings-lock-screen' allows the user to change how they unlock their
8 * device. 8 * device.
9 * 9 *
10 * Example: 10 * Example:
11 * 11 *
12 * <settings-lock-screen 12 * <settings-lock-screen
13 * prefs="{{prefs}}"> 13 * prefs="{{prefs}}">
14 * </settings-lock-screen> 14 * </settings-lock-screen>
15 */ 15 */
16 16
17 /**
18 * Possible values of the proximity threshould displayed to the user.
19 * This should be kept in sync with the enum defined here:
20 * components/proximity_auth/proximity_monitor_impl.cc
21 */
22 settings.EasyUnlockProximityThreshold = {
23 VERY_CLOSE: 0,
24 CLOSE: 1,
25 FAR: 2,
26 VERY_FAR: 3,
27 };
28
17 Polymer({ 29 Polymer({
18 is: 'settings-lock-screen', 30 is: 'settings-lock-screen',
19 31
20 behaviors: [ 32 behaviors: [
21 I18nBehavior, 33 I18nBehavior,
22 LockStateBehavior, 34 LockStateBehavior,
23 WebUIListenerBehavior, 35 WebUIListenerBehavior,
24 settings.RouteObserverBehavior, 36 settings.RouteObserverBehavior,
25 ], 37 ],
26 38
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 */ 123 */
112 easyUnlockProximityDetectionAllowed_: { 124 easyUnlockProximityDetectionAllowed_: {
113 type: Boolean, 125 type: Boolean,
114 value: function() { 126 value: function() {
115 return loadTimeData.getBoolean('easyUnlockAllowed') && 127 return loadTimeData.getBoolean('easyUnlockAllowed') &&
116 loadTimeData.getBoolean('easyUnlockProximityDetectionAllowed'); 128 loadTimeData.getBoolean('easyUnlockProximityDetectionAllowed');
117 }, 129 },
118 readOnly: true, 130 readOnly: true,
119 }, 131 },
120 132
133 /**
134 * Returns the proximity threshold mapping to be displayed in the
135 * threshold selector dropdown menu.
stevenjb 2017/07/17 16:43:37 * @type {DropdownMenuOptionList} (You will need t
sacomoto 2017/07/20 19:50:15 Done.
136 */
137 easyUnlockProximityThresholdMapping_: {
138 type: Array,
139 value: function() {
140 return [
141 {
142 value: settings.EasyUnlockProximityThreshold.VERY_CLOSE,
143 name:
144 loadTimeData.getString('easyUnlockProximityThresholdVeryClose')
145 },
146 {
147 value: settings.EasyUnlockProximityThreshold.CLOSE,
148 name: loadTimeData.getString('easyUnlockProximityThresholdClose')
149 },
150 {
151 value: settings.EasyUnlockProximityThreshold.FAR,
152 name: loadTimeData.getString('easyUnlockProximityThresholdFar')
153 },
154 {
155 value: settings.EasyUnlockProximityThreshold.VERY_FAR,
156 name: loadTimeData.getString('easyUnlockProximityThresholdVeryFar')
157 }
158 ];
159 },
160 readOnly: true,
161 },
162
121 /** @private */ 163 /** @private */
122 showEasyUnlockTurnOffDialog_: { 164 showEasyUnlockTurnOffDialog_: {
123 type: Boolean, 165 type: Boolean,
124 value: false, 166 value: false,
125 }, 167 },
126 168
127 /** @private */ 169 /** @private */
128 showPasswordPromptDialog_: Boolean, 170 showPasswordPromptDialog_: Boolean,
129 171
130 /** @private */ 172 /** @private */
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 /** 374 /**
333 * @param {boolean} easyUnlockEnabled 375 * @param {boolean} easyUnlockEnabled
334 * @param {boolean} proximityDetectionAllowed 376 * @param {boolean} proximityDetectionAllowed
335 * @private 377 * @private
336 */ 378 */
337 getShowEasyUnlockToggle_: function( 379 getShowEasyUnlockToggle_: function(
338 easyUnlockEnabled, proximityDetectionAllowed) { 380 easyUnlockEnabled, proximityDetectionAllowed) {
339 return easyUnlockEnabled && proximityDetectionAllowed; 381 return easyUnlockEnabled && proximityDetectionAllowed;
340 }, 382 },
341 }); 383 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698