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

Side by Side Diff: chrome/test/data/webui/settings/fake_quick_unlock_uma.js

Issue 2313103002: Added uma for pin unlock set up. (Closed)
Patch Set: Closure compiler fix. Created 4 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview Fake implementation of chrome histogram recording for testing.
7 */
8 cr.define('settings', function() {
9 /**
10 * Fake of the chrome.quickUnlockUma.
11 * @constructor
12 */
13 function FakeQuickUnlockUma() {
14 this.histogram = {};
15 for (var key in LockScreenProgress)
16 this.histogram[LockScreenProgress[key]] = 0;
17 }
18
19 FakeQuickUnlockUma.prototype = {
20 /**
21 * Update the histgoram at |key| by one.
22 * @param {LockScreenProgress} key
23 */
24 recordProgress: function(key) {
25 if (!(key in this.histogram))
26 this.histogram[key] = 0;
27 this.histogram[key]++;
28 },
29
30 /**
31 * Get the value of the uma histogram at |key|.
32 * @param {LockScreenProgress} key
33 * @return {Number}
34 */
35 getHistogramValue: function(key) {
36 return this.histogram[key];
37 }
38 };
39
40 return {FakeQuickUnlockUma: FakeQuickUnlockUma};
41 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698