| Index: chrome/browser/extensions/extension_event_histogram_value.h
|
| diff --git a/chrome/browser/extensions/extension_event_histogram_value.h b/chrome/browser/extensions/extension_event_histogram_value.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d7d193a692e0a15d8ee639a3037842421cc7482d
|
| --- /dev/null
|
| +++ b/chrome/browser/extensions/extension_event_histogram_value.h
|
| @@ -0,0 +1,181 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_HISTOGRAM_VALUE_H_
|
| +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_HISTOGRAM_VALUE_H_
|
| +
|
| +
|
| +namespace extensions {
|
| +namespace events {
|
| +
|
| +// Short version:
|
| +// *Never* reorder or delete entries in the |HistogramValue| enumeration.
|
| +// When creating a new extension event, add a new entry at the end of the
|
| +// enum, just prior to ENUM_BOUNDARY.
|
| +//
|
| +// Long version:
|
| +// This enumeration is used to associate a unique integer value to each
|
| +// extension event so that their usage can be recorded in histogram charts.
|
| +// Given we want the values recorded in the these charts to remain stable over
|
| +// time for comparison purposes, once an entry has been added to the
|
| +// enumeration, it should never be removed or moved to another spot in the
|
| +// enum.
|
| +//
|
| +// Here are instructions how to manage entries depending on what you are trying
|
| +// to achieve.
|
| +//
|
| +// 1) Creating a new extension event:
|
| +//
|
| +// Add a new entry at the end of the |HistogramValue| enum. The name of the
|
| +// entry should follow this algorithm:
|
| +// a) Take the string value passed as the event_name argument to
|
| +// EventRouter::AddEventListener.
|
| +// b) Replace '.' with '_'.
|
| +// c) Make all letters uppercase.
|
| +//
|
| +// Example: "tabs.onCreated" -> TABS_ONCREATED
|
| +//
|
| +// 2) Deleting an existing event:
|
| +//
|
| +// Given an existing entry should *never* be removed from this enumeration,
|
| +// it is recommended to add a "DELETED_" prefix to the existing entry.
|
| +//
|
| +// 3) Renaming an existing event:
|
| +//
|
| +// There are 2 options, depending if you want to keep accruing data in the
|
| +// *existing* histogram stream or in a *new* one.
|
| +//
|
| +// a) If you want keep recording usages of the extension event in the
|
| +// *existing* histogram stream, rename the enum entry to match
|
| +// the new extension event name, following the same naming rule as
|
| +// mentioned in 1). The enum entry will keep the same underlying integer
|
| +// value, so the same histogram stream will be used for recording
|
| +// usages. You will also need to change the API idl/json file to include
|
| +// a histogram_value property that contains the old event name.
|
| +//
|
| +// b) If you want start recording usages of the extension event to in a
|
| +// *new* histogram stream, follow the instructions in step 1) and 2)
|
| +// above. This will effectively deprecate the old histogram stream and
|
| +// creates a new one for the new event name.
|
| +//
|
| +enum HistogramValue {
|
| + UNKNOWN = 0,
|
| + FONTSETTINGS_ONFONTCHANGED,
|
| + FONTSETTINGS_ONDEFAULTFONTSIZECHANGED,
|
| + FONTSETTINGS_ONDEFAULTFIXEDFONTSIZECHANGED,
|
| + FONTSETTINGS_ONMINIMUMFONTSIZECHANGED,
|
| + COOKIES_ONCHANGED,
|
| + DEBUGGER_ONEVENT,
|
| + DEBUGGER_ONDETACH,
|
| + TABS_ONCREATED,
|
| + TABS_ONUPDATED,
|
| + TABS_ONMOVED,
|
| + TABS_ONSELECTIONCHANGED,
|
| + TABS_ONACTIVECHANGED,
|
| + TABS_ONACTIVATED,
|
| + TABS_ONHIGHLIGHTCHANGED,
|
| + TABS_ONHIGHLIGHTED,
|
| + TABS_ONDETACHED,
|
| + TABS_ONATTACHED,
|
| + TABS_ONREMOVED,
|
| + TABS_ONREPLACED,
|
| + SYSTEMINDICATOR_ONCLICKED,
|
| + SYNCFILESYSTEM_ONSERVICESTATUSCHANGED,
|
| + SYNCFILESYSTEM_ONFILESTATUSCHANGED,
|
| + EXPERIMENTAL_ACCESSIBILITY_ONWINDOWOPENED,
|
| + EXPERIMENTAL_ACCESSIBILITY_ONWINDOWCLOSED,
|
| + EXPERIMENTAL_ACCESSIBILITY_ONCONTROLFOCUSED,
|
| + EXPERIMENTAL_ACCESSIBILITY_ONCONTROLACTION,
|
| + EXPERIMENTAL_ACCESSIBILITY_ONTEXTCHANGED,
|
| + EXPERIMENTAL_ACCESSIBILITY_ONMENUOPENED,
|
| + EXPERIMENTAL_ACCESSIBILITY_ONMENUCLOSED,
|
| + TERMINALPRIVATE_ONPROCESSOUTPUT,
|
| + BLUETOOTH_ONADAPTERSTATECHANGED,
|
| + WEBREQUEST_ONBEFOREREQUEST,
|
| + WEBREQUEST_ONERROROCCURRED,
|
| + BOOKMARKS_ONCREATED,
|
| + BOOKMARKS_ONREMOVED,
|
| + BOOKMARKS_ONCHANGED,
|
| + BOOKMARKS_ONMOVED,
|
| + BOOKMARKS_ONCHILDRENREORDERED,
|
| + BOOKMARKS_ONIMPORTBEGAN,
|
| + BOOKMARKS_ONIMPORTENDED,
|
| + CONTEXTMENUS_ONCLICKED,
|
| + MEDIAPLAYERPRIVATE_ONNEXTTRACK,
|
| + MEDIAPLAYERPRIVATE_ONPLAYLISTCHANGED,
|
| + MEDIAPLAYERPRIVATE_ONPREVTRACK,
|
| + MEDIAPLAYERPRIVATE_ONTOGGLEPLAYSTATE,
|
| + EXPERIMENTAL_SYSTEMINFO_CPU_ONUPDATED,
|
| + DIAL_ONDEVICELIST,
|
| + DIAL_ONERROR,
|
| + MANAGEMENT_ONINSTALLED,
|
| + MANAGEMENT_ONUNINSTALLED,
|
| + MANAGEMENT_ONENABLED,
|
| + MANAGEMENT_ONDISABLED,
|
| + WINDOWS_ONCREATED,
|
| + WINDOWS_ONREMOVED,
|
| + WINDOWS_ONFOCUSCHANGED,
|
| + STORAGE_ONCHANGED,
|
| + PAGELAUNCHER_ONCLICKED,
|
| + TABCAPTURE_ONSTATUSCHANGED,
|
| + TEST_ONMESSAGE,
|
| + WEBNAVIGATION_ONBEFORENAVIGATE,
|
| + WEBNAVIGATION_ONCOMMITTED,
|
| + WEBNAVIGATION_ONDOMCONTENTLOADED,
|
| + WEBNAVIGATION_ONCOMPLETED,
|
| + WEBNAVIGATION_ONERROROCCURRED,
|
| + WEBNAVIGATION_ONCREATEDNAVIGATIONTARGET,
|
| + WEBNAVIGATION_ONREFERENCEFRAGMENTUPDATED,
|
| + WEBNAVIGATION_ONTABREPLACED,
|
| + WEBNAVIGATION_ONHISTORYSTATEUPDATED,
|
| + APP_CURRENTWINDOWINTERNAL_ONCLOSED,
|
| + APP_CURRENTWINDOWINTERNAL_ONBOUNDSCHANGED,
|
| + APP_CURRENTWINDOWINTERNAL_ONMINIMIZED,
|
| + APP_CURRENTWINDOWINTERNAL_ONMAXIMIZED,
|
| + APP_CURRENTWINDOWINTERNAL_ONRESTORED,
|
| + MANAGEDMODEPRIVATE_ONCHANGE,
|
| + PUSHMESSAGING_ONMESSAGE,
|
| + RTCPRIVATE_ONLAUNCH,
|
| + DOWNLOADS_ONCREATED,
|
| + DOWNLOADS_ONERASED,
|
| + DOWNLOADS_ONCHANGED,
|
| + NETWORKINGPRIVATE_ONNETWORKSCHANGED,
|
| + NETWORKINGPRIVATE_ONNETWORKLISTCHANGED,
|
| + OMNIBOX_ONINPUTSTARTED,
|
| + OMNIBOX_ONINPUTCHANGED,
|
| + OMNIBOX_ONINPUTENTERED,
|
| + OMNIBOX_ONINPUTCANCELLED,
|
| + SYSTEMINFO_DISPLAY_ONDISPLAYCHANGED,
|
| + MEDIAGALLERIESPRIVATE_ONDEVICEATTACHED,
|
| + MEDIAGALLERIESPRIVATE_ONDEVICEDETACHED,
|
| + MEDIAGALLERIESPRIVATE_ONGALLERYCHANGED,
|
| + APP_RUNTIME_ONLAUNCHED,
|
| + APP_RUNTIME_ONRESTARTED,
|
| + EXTENSION_ONREQUEST,
|
| + EXTENSION_ONREQUESTEXTERNAL,
|
| + BOOKMARKMANAGERPRIVATE_ONDRAGENTER,
|
| + BOOKMARKMANAGERPRIVATE_ONDRAGLEAVE,
|
| + BOOKMARKMANAGERPRIVATE_ONDROP,
|
| + SYSTEMPRIVATE_ONVOLUMECHANGED,
|
| + SYSTEMPRIVATE_ONBRIGHTNESSCHANGED,
|
| + SYSTEMPRIVATE_ONSCREENUNLOCKED,
|
| + SYSTEMPRIVATE_ONWOKEUP,
|
| + IDLE_ONSTATECHANGED,
|
| + EXPERIMENTAL_NOTIFICATION_ONDISPLAYED,
|
| + EXPERIMENTAL_NOTIFICATION_ONCLOSED,
|
| + EXPERIMENTAL_NOTIFICATION_ONCLICKED,
|
| + EXPERIMENTAL_NOTIFICATION_ONBUTTONCLICKED,
|
| + EXPERIMENTAL_SYSTEMINFO_STORAGE_ONAVAILABLECAPACITYCHANGED,
|
| + ALARMS_ONALARM,
|
| + PERMISSIONS_ONADDED,
|
| + PERMISSIONS_ONREMOVED,
|
| + HISTORY_ONVISITED,
|
| + HISTORY_ONVISITREMOVED,
|
| + ENUM_BOUNDARY // Last entry: Add new entries above.
|
| +};
|
| +
|
| +} // namespace events
|
| +} // namespace extensions
|
| +
|
| +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_HISTOGRAM_VALUE_H_
|
|
|