Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate lock_screen_constants.js to typescript
Fixed: b/281496121 Change-Id: I5c376bbc48f7345f4333700e00311be8047a0b7e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574669 Reviewed-by: Denis Kuznetsov <antrim@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Auto-Submit: Martin Bidlingmaier <mbid@google.com> Commit-Queue: Martin Bidlingmaier <mbid@google.com> Reviewed-by: Wes Okuhara <wesokuhara@google.com> Cr-Commit-Position: refs/heads/main@{#1152896}
- Loading branch information
Showing
6 changed files
with
48 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
ash/webui/common/resources/quick_unlock/lock_screen_constants.js
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
ash/webui/common/resources/quick_unlock/lock_screen_constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2016 The Chromium Authors | ||
// 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. | ||
*/ | ||
const PIN_UNLOCK_UMA_HISTOGRAM_NAME = 'Settings.PinUnlockSetup'; | ||
|
||
/** | ||
* Stages the user can enter while setting up pin unlock. | ||
*/ | ||
export enum LockScreenProgress { | ||
START_SCREEN_LOCK = 0, | ||
ENTER_PASSWORD_CORRECTLY = 1, | ||
CHOOSE_PIN_OR_PASSWORD = 2, | ||
ENTER_PIN = 3, | ||
CONFIRM_PIN = 4, | ||
} | ||
|
||
const LOCK_SCREEN_PROGRESS_BUCKET_NUMBER = LockScreenProgress.CONFIRM_PIN + 1; | ||
|
||
/** | ||
* Helper function to send the progress of the pin setup to be recorded in the | ||
* histogram. | ||
*/ | ||
export function recordLockScreenProgress(currentProgress: LockScreenProgress) { | ||
if (currentProgress >= LOCK_SCREEN_PROGRESS_BUCKET_NUMBER) { | ||
console.error(`Expected an enumeration value lower than ${ | ||
LOCK_SCREEN_PROGRESS_BUCKET_NUMBER}, got ${currentProgress}.`); | ||
return; | ||
} | ||
chrome.send('metricsHandler:recordInHistogram', [ | ||
PIN_UNLOCK_UMA_HISTOGRAM_NAME, | ||
currentProgress, | ||
LOCK_SCREEN_PROGRESS_BUCKET_NUMBER, | ||
]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters