| Index: chrome/browser/resources/settings/people_page/lock_screen_constants.js
|
| diff --git a/chrome/browser/resources/settings/people_page/lock_screen_constants.js b/chrome/browser/resources/settings/people_page/lock_screen_constants.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2fc1ad4c64e200c17ff85d50400937ea1203edb7
|
| --- /dev/null
|
| +++ b/chrome/browser/resources/settings/people_page/lock_screen_constants.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.
|
| +
|
| +/**
|
| + * @fileoverview Constants used for logging the pin unlock setup uma.
|
| + */
|
| +
|
| +/**
|
| + * Name of the pin unlock setup uma histogram.
|
| + * @type {string}
|
| + */
|
| +var PinUnlockUmaHistogramName = 'Settings.PinUnlockSetup';
|
| +
|
| +/**
|
| + * Stages the user can enter while setting up pin unlock.
|
| + * @enum {number}
|
| + */
|
| +var LockScreenProgress = {
|
| + START_SCREEN_LOCK: 0,
|
| + ENTER_PASSWORD_CORRECTLY: 1,
|
| + CHOOSE_PIN_OR_PASSWORD: 2,
|
| + ENTER_PIN: 3,
|
| + CONFIRM_PIN: 4,
|
| + MAX_BUCKET: 5
|
| +};
|
| +
|
| +cr.define('settings', function() {
|
| +/**
|
| + * Helper function to send the progress of the pin setup to be recorded in the
|
| + * histogram.
|
| + * @param {LockScreenProgress} currentProgress
|
| + */
|
| +var recordLockScreenProgress = function(currentProgress) {
|
| + if (currentProgress >= LockScreenProgress.MAX_BUCKET) {
|
| + console.error('Expected a enumeration value of ' +
|
| + LockScreenProgress.MAX_BUCKET + ' or lower: Received ' +
|
| + currentProgress + '.');
|
| + return;
|
| + }
|
| + chrome.send('metricsHandler:recordInHistogram',
|
| + [PinUnlockUmaHistogramName, currentProgress,
|
| + LockScreenProgress.MAX_BUCKET]);
|
| +};
|
| +
|
| + return {
|
| + recordLockScreenProgress: recordLockScreenProgress
|
| + };
|
| +});
|
|
|