| OLD | NEW |
| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 resources: 2, | 64 resources: 2, |
| 65 network: 3, | 65 network: 3, |
| 66 sources: 4, | 66 sources: 4, |
| 67 timeline: 5, | 67 timeline: 5, |
| 68 profiles: 6, | 68 profiles: 6, |
| 69 audits: 7, | 69 audits: 7, |
| 70 console: 8, | 70 console: 8, |
| 71 layers: 9 | 71 layers: 9 |
| 72 } | 72 } |
| 73 | 73 |
| 74 WebInspector.UserMetrics._DrawerCodes = { |
| 75 "console": 1, |
| 76 "animations": 2, |
| 77 "network.config": 3, |
| 78 "rendering": 4, |
| 79 "sensors": 5, |
| 80 "sources.search": 6 |
| 81 } |
| 82 |
| 74 WebInspector.UserMetrics.prototype = { | 83 WebInspector.UserMetrics.prototype = { |
| 75 /** | 84 /** |
| 76 * @param {string} panelName | 85 * @param {string} panelName |
| 77 */ | 86 */ |
| 78 panelShown: function(panelName) | 87 panelShown: function(panelName) |
| 79 { | 88 { |
| 80 var code = WebInspector.UserMetrics._PanelCodes[panelName] || 0; | 89 var code = WebInspector.UserMetrics._PanelCodes[panelName] || 0; |
| 81 var size = Object.keys(WebInspector.UserMetrics._PanelCodes).length + 1; | 90 var size = Object.keys(WebInspector.UserMetrics._PanelCodes).length + 1; |
| 82 InspectorFrontendHost.recordEnumeratedHistogram("DevTools.PanelShown", c
ode, size); | 91 InspectorFrontendHost.recordEnumeratedHistogram("DevTools.PanelShown", c
ode, size); |
| 83 }, | 92 }, |
| 84 | 93 |
| 85 /** | 94 /** |
| 95 * @param {string} viewId |
| 96 */ |
| 97 drawerShown: function(viewId) |
| 98 { |
| 99 var code = WebInspector.UserMetrics._DrawerCodes[viewId] || 0; |
| 100 var size = Object.keys(WebInspector.UserMetrics._DrawerCodes).length + 1
; |
| 101 InspectorFrontendHost.recordEnumeratedHistogram("DevTools.DrawerShown",
code, size); |
| 102 }, |
| 103 |
| 104 /** |
| 86 * @param {!WebInspector.UserMetrics.Action} action | 105 * @param {!WebInspector.UserMetrics.Action} action |
| 87 */ | 106 */ |
| 88 actionTaken: function(action) | 107 actionTaken: function(action) |
| 89 { | 108 { |
| 90 var size = Object.keys(WebInspector.UserMetrics.Action).length + 1; | 109 var size = Object.keys(WebInspector.UserMetrics.Action).length + 1; |
| 91 InspectorFrontendHost.recordEnumeratedHistogram("DevTools.ActionTaken",
action, size); | 110 InspectorFrontendHost.recordEnumeratedHistogram("DevTools.ActionTaken",
action, size); |
| 92 } | 111 } |
| 93 } | 112 } |
| 94 | 113 |
| 95 /** @type {!WebInspector.UserMetrics} */ | 114 /** @type {!WebInspector.UserMetrics} */ |
| 96 WebInspector.userMetrics = new WebInspector.UserMetrics(); | 115 WebInspector.userMetrics = new WebInspector.UserMetrics(); |
| OLD | NEW |