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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/host/UserMetrics.js

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @unrestricted 32 * @unrestricted
33 */ 33 */
34 WebInspector.UserMetrics = class { 34 Host.UserMetrics = class {
35 /** 35 /**
36 * @param {string} panelName 36 * @param {string} panelName
37 */ 37 */
38 panelShown(panelName) { 38 panelShown(panelName) {
39 var code = WebInspector.UserMetrics._PanelCodes[panelName] || 0; 39 var code = Host.UserMetrics._PanelCodes[panelName] || 0;
40 var size = Object.keys(WebInspector.UserMetrics._PanelCodes).length + 1; 40 var size = Object.keys(Host.UserMetrics._PanelCodes).length + 1;
41 InspectorFrontendHost.recordEnumeratedHistogram('DevTools.PanelShown', code, size); 41 InspectorFrontendHost.recordEnumeratedHistogram('DevTools.PanelShown', code, size);
42 } 42 }
43 43
44 /** 44 /**
45 * @param {string} drawerId 45 * @param {string} drawerId
46 */ 46 */
47 drawerShown(drawerId) { 47 drawerShown(drawerId) {
48 this.panelShown('drawer-' + drawerId); 48 this.panelShown('drawer-' + drawerId);
49 } 49 }
50 50
51 /** 51 /**
52 * @param {!WebInspector.UserMetrics.Action} action 52 * @param {!Host.UserMetrics.Action} action
53 */ 53 */
54 actionTaken(action) { 54 actionTaken(action) {
55 var size = Object.keys(WebInspector.UserMetrics.Action).length + 1; 55 var size = Object.keys(Host.UserMetrics.Action).length + 1;
56 InspectorFrontendHost.recordEnumeratedHistogram('DevTools.ActionTaken', acti on, size); 56 InspectorFrontendHost.recordEnumeratedHistogram('DevTools.ActionTaken', acti on, size);
57 } 57 }
58 }; 58 };
59 59
60 // Codes below are used to collect UMA histograms in the Chromium port. 60 // Codes below are used to collect UMA histograms in the Chromium port.
61 // Do not change the values below, additional actions are needed on the Chromium side 61 // Do not change the values below, additional actions are needed on the Chromium side
62 // in order to add more codes. 62 // in order to add more codes.
63 63
64 /** @enum {number} */ 64 /** @enum {number} */
65 WebInspector.UserMetrics.Action = { 65 Host.UserMetrics.Action = {
66 WindowDocked: 1, 66 WindowDocked: 1,
67 WindowUndocked: 2, 67 WindowUndocked: 2,
68 ScriptsBreakpointSet: 3, 68 ScriptsBreakpointSet: 3,
69 TimelineStarted: 4, 69 TimelineStarted: 4,
70 ProfilesCPUProfileTaken: 5, 70 ProfilesCPUProfileTaken: 5,
71 ProfilesHeapProfileTaken: 6, 71 ProfilesHeapProfileTaken: 6,
72 AuditsStarted: 7, 72 AuditsStarted: 7,
73 ConsoleEvaluated: 8, 73 ConsoleEvaluated: 8,
74 FileSavedInWorkspace: 9, 74 FileSavedInWorkspace: 9,
75 DeviceModeEnabled: 10, 75 DeviceModeEnabled: 10,
76 AnimationsPlaybackRateChanged: 11, 76 AnimationsPlaybackRateChanged: 11,
77 RevisionApplied: 12, 77 RevisionApplied: 12,
78 FileSystemDirectoryContentReceived: 13, 78 FileSystemDirectoryContentReceived: 13,
79 StyleRuleEdited: 14, 79 StyleRuleEdited: 14,
80 CommandEvaluatedInConsolePanel: 15, 80 CommandEvaluatedInConsolePanel: 15,
81 DOMPropertiesExpanded: 16, 81 DOMPropertiesExpanded: 16,
82 ResizedViewInResponsiveMode: 17 82 ResizedViewInResponsiveMode: 17
83 }; 83 };
84 84
85 WebInspector.UserMetrics._PanelCodes = { 85 Host.UserMetrics._PanelCodes = {
86 elements: 1, 86 elements: 1,
87 resources: 2, 87 resources: 2,
88 network: 3, 88 network: 3,
89 sources: 4, 89 sources: 4,
90 timeline: 5, 90 timeline: 5,
91 profiles: 6, 91 profiles: 6,
92 audits: 7, 92 audits: 7,
93 console: 8, 93 console: 8,
94 layers: 9, 94 layers: 9,
95 'drawer-console': 10, 95 'drawer-console': 10,
96 'drawer-animations': 11, 96 'drawer-animations': 11,
97 'drawer-network.config': 12, 97 'drawer-network.config': 12,
98 'drawer-rendering': 13, 98 'drawer-rendering': 13,
99 'drawer-sensors': 14, 99 'drawer-sensors': 14,
100 'drawer-sources.search': 15, 100 'drawer-sources.search': 15,
101 security: 16 101 security: 16
102 }; 102 };
103 103
104 /** @type {!WebInspector.UserMetrics} */ 104 /** @type {!Host.UserMetrics} */
105 WebInspector.userMetrics = new WebInspector.UserMetrics(); 105 Host.userMetrics = new Host.UserMetrics();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698