OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_HISTOGRAM_VALUE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_HISTOGRAM_VALUE_H_ |
| 7 |
| 8 |
| 9 namespace extensions { |
| 10 namespace events { |
| 11 |
| 12 // Short version: |
| 13 // *Never* reorder or delete entries in the |HistogramValue| enumeration. |
| 14 // When creating a new extension event, add a new entry at the end of the |
| 15 // enum, just prior to ENUM_BOUNDARY. |
| 16 // |
| 17 // Long version: |
| 18 // This enumeration is used to associate a unique integer value to each |
| 19 // extension event so that their usage can be recorded in histogram charts. |
| 20 // Given we want the values recorded in the these charts to remain stable over |
| 21 // time for comparison purposes, once an entry has been added to the |
| 22 // enumeration, it should never be removed or moved to another spot in the |
| 23 // enum. |
| 24 // |
| 25 // Here are instructions how to manage entries depending on what you are trying |
| 26 // to achieve. |
| 27 // |
| 28 // 1) Creating a new extension event: |
| 29 // |
| 30 // Add a new entry at the end of the |HistogramValue| enum. The name of the |
| 31 // entry should follow this algorithm: |
| 32 // a) Take the string value passed as the event_name argument to |
| 33 // EventRouter::AddEventListener. |
| 34 // b) Replace '.' with '_'. |
| 35 // c) Make all letters uppercase. |
| 36 // |
| 37 // Example: "tabs.onCreated" -> TABS_ONCREATED |
| 38 // |
| 39 // 2) Deleting an existing event: |
| 40 // |
| 41 // Given an existing entry should *never* be removed from this enumeration, |
| 42 // it is recommended to add a "DELETED_" prefix to the existing entry. |
| 43 // |
| 44 // 3) Renaming an existing event: |
| 45 // |
| 46 // There are 2 options, depending if you want to keep accruing data in the |
| 47 // *existing* histogram stream or in a *new* one. |
| 48 // |
| 49 // a) If you want keep recording usages of the extension event in the |
| 50 // *existing* histogram stream, rename the enum entry to match |
| 51 // the new extension event name, following the same naming rule as |
| 52 // mentioned in 1). The enum entry will keep the same underlying integer |
| 53 // value, so the same histogram stream will be used for recording |
| 54 // usages. You will also need to change the API idl/json file to include |
| 55 // a histogram_value property that contains the old event name. |
| 56 // |
| 57 // b) If you want start recording usages of the extension event to in a |
| 58 // *new* histogram stream, follow the instructions in step 1) and 2) |
| 59 // above. This will effectively deprecate the old histogram stream and |
| 60 // creates a new one for the new event name. |
| 61 // |
| 62 enum HistogramValue { |
| 63 UNKNOWN = 0, |
| 64 FONTSETTINGS_ONFONTCHANGED, |
| 65 FONTSETTINGS_ONDEFAULTFONTSIZECHANGED, |
| 66 FONTSETTINGS_ONDEFAULTFIXEDFONTSIZECHANGED, |
| 67 FONTSETTINGS_ONMINIMUMFONTSIZECHANGED, |
| 68 COOKIES_ONCHANGED, |
| 69 DEBUGGER_ONEVENT, |
| 70 DEBUGGER_ONDETACH, |
| 71 TABS_ONCREATED, |
| 72 TABS_ONUPDATED, |
| 73 TABS_ONMOVED, |
| 74 TABS_ONSELECTIONCHANGED, |
| 75 TABS_ONACTIVECHANGED, |
| 76 TABS_ONACTIVATED, |
| 77 TABS_ONHIGHLIGHTCHANGED, |
| 78 TABS_ONHIGHLIGHTED, |
| 79 TABS_ONDETACHED, |
| 80 TABS_ONATTACHED, |
| 81 TABS_ONREMOVED, |
| 82 TABS_ONREPLACED, |
| 83 SYSTEMINDICATOR_ONCLICKED, |
| 84 SYNCFILESYSTEM_ONSERVICESTATUSCHANGED, |
| 85 SYNCFILESYSTEM_ONFILESTATUSCHANGED, |
| 86 EXPERIMENTAL_ACCESSIBILITY_ONWINDOWOPENED, |
| 87 EXPERIMENTAL_ACCESSIBILITY_ONWINDOWCLOSED, |
| 88 EXPERIMENTAL_ACCESSIBILITY_ONCONTROLFOCUSED, |
| 89 EXPERIMENTAL_ACCESSIBILITY_ONCONTROLACTION, |
| 90 EXPERIMENTAL_ACCESSIBILITY_ONTEXTCHANGED, |
| 91 EXPERIMENTAL_ACCESSIBILITY_ONMENUOPENED, |
| 92 EXPERIMENTAL_ACCESSIBILITY_ONMENUCLOSED, |
| 93 TERMINALPRIVATE_ONPROCESSOUTPUT, |
| 94 BLUETOOTH_ONADAPTERSTATECHANGED, |
| 95 WEBREQUEST_ONBEFOREREQUEST, |
| 96 WEBREQUEST_ONERROROCCURRED, |
| 97 BOOKMARKS_ONCREATED, |
| 98 BOOKMARKS_ONREMOVED, |
| 99 BOOKMARKS_ONCHANGED, |
| 100 BOOKMARKS_ONMOVED, |
| 101 BOOKMARKS_ONCHILDRENREORDERED, |
| 102 BOOKMARKS_ONIMPORTBEGAN, |
| 103 BOOKMARKS_ONIMPORTENDED, |
| 104 CONTEXTMENUS_ONCLICKED, |
| 105 MEDIAPLAYERPRIVATE_ONNEXTTRACK, |
| 106 MEDIAPLAYERPRIVATE_ONPLAYLISTCHANGED, |
| 107 MEDIAPLAYERPRIVATE_ONPREVTRACK, |
| 108 MEDIAPLAYERPRIVATE_ONTOGGLEPLAYSTATE, |
| 109 EXPERIMENTAL_SYSTEMINFO_CPU_ONUPDATED, |
| 110 DIAL_ONDEVICELIST, |
| 111 DIAL_ONERROR, |
| 112 MANAGEMENT_ONINSTALLED, |
| 113 MANAGEMENT_ONUNINSTALLED, |
| 114 MANAGEMENT_ONENABLED, |
| 115 MANAGEMENT_ONDISABLED, |
| 116 WINDOWS_ONCREATED, |
| 117 WINDOWS_ONREMOVED, |
| 118 WINDOWS_ONFOCUSCHANGED, |
| 119 STORAGE_ONCHANGED, |
| 120 PAGELAUNCHER_ONCLICKED, |
| 121 TABCAPTURE_ONSTATUSCHANGED, |
| 122 TEST_ONMESSAGE, |
| 123 WEBNAVIGATION_ONBEFORENAVIGATE, |
| 124 WEBNAVIGATION_ONCOMMITTED, |
| 125 WEBNAVIGATION_ONDOMCONTENTLOADED, |
| 126 WEBNAVIGATION_ONCOMPLETED, |
| 127 WEBNAVIGATION_ONERROROCCURRED, |
| 128 WEBNAVIGATION_ONCREATEDNAVIGATIONTARGET, |
| 129 WEBNAVIGATION_ONREFERENCEFRAGMENTUPDATED, |
| 130 WEBNAVIGATION_ONTABREPLACED, |
| 131 WEBNAVIGATION_ONHISTORYSTATEUPDATED, |
| 132 APP_CURRENTWINDOWINTERNAL_ONCLOSED, |
| 133 APP_CURRENTWINDOWINTERNAL_ONBOUNDSCHANGED, |
| 134 APP_CURRENTWINDOWINTERNAL_ONMINIMIZED, |
| 135 APP_CURRENTWINDOWINTERNAL_ONMAXIMIZED, |
| 136 APP_CURRENTWINDOWINTERNAL_ONRESTORED, |
| 137 MANAGEDMODEPRIVATE_ONCHANGE, |
| 138 PUSHMESSAGING_ONMESSAGE, |
| 139 RTCPRIVATE_ONLAUNCH, |
| 140 DOWNLOADS_ONCREATED, |
| 141 DOWNLOADS_ONERASED, |
| 142 DOWNLOADS_ONCHANGED, |
| 143 NETWORKINGPRIVATE_ONNETWORKSCHANGED, |
| 144 NETWORKINGPRIVATE_ONNETWORKLISTCHANGED, |
| 145 OMNIBOX_ONINPUTSTARTED, |
| 146 OMNIBOX_ONINPUTCHANGED, |
| 147 OMNIBOX_ONINPUTENTERED, |
| 148 OMNIBOX_ONINPUTCANCELLED, |
| 149 SYSTEMINFO_DISPLAY_ONDISPLAYCHANGED, |
| 150 MEDIAGALLERIESPRIVATE_ONDEVICEATTACHED, |
| 151 MEDIAGALLERIESPRIVATE_ONDEVICEDETACHED, |
| 152 MEDIAGALLERIESPRIVATE_ONGALLERYCHANGED, |
| 153 APP_RUNTIME_ONLAUNCHED, |
| 154 APP_RUNTIME_ONRESTARTED, |
| 155 EXTENSION_ONREQUEST, |
| 156 EXTENSION_ONREQUESTEXTERNAL, |
| 157 BOOKMARKMANAGERPRIVATE_ONDRAGENTER, |
| 158 BOOKMARKMANAGERPRIVATE_ONDRAGLEAVE, |
| 159 BOOKMARKMANAGERPRIVATE_ONDROP, |
| 160 SYSTEMPRIVATE_ONVOLUMECHANGED, |
| 161 SYSTEMPRIVATE_ONBRIGHTNESSCHANGED, |
| 162 SYSTEMPRIVATE_ONSCREENUNLOCKED, |
| 163 SYSTEMPRIVATE_ONWOKEUP, |
| 164 IDLE_ONSTATECHANGED, |
| 165 EXPERIMENTAL_NOTIFICATION_ONDISPLAYED, |
| 166 EXPERIMENTAL_NOTIFICATION_ONCLOSED, |
| 167 EXPERIMENTAL_NOTIFICATION_ONCLICKED, |
| 168 EXPERIMENTAL_NOTIFICATION_ONBUTTONCLICKED, |
| 169 EXPERIMENTAL_SYSTEMINFO_STORAGE_ONAVAILABLECAPACITYCHANGED, |
| 170 ALARMS_ONALARM, |
| 171 PERMISSIONS_ONADDED, |
| 172 PERMISSIONS_ONREMOVED, |
| 173 HISTORY_ONVISITED, |
| 174 HISTORY_ONVISITREMOVED, |
| 175 ENUM_BOUNDARY // Last entry: Add new entries above. |
| 176 }; |
| 177 |
| 178 } // namespace events |
| 179 } // namespace extensions |
| 180 |
| 181 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_HISTOGRAM_VALUE_H_ |
OLD | NEW |