Skip to content

Commit

Permalink
Add UMA for app info dialog
Browse files Browse the repository at this point in the history
Add UMA to track how many users open the app info dialog.

BUG=395501

Review URL: https://codereview.chromium.org/424943002

Cr-Commit-Position: refs/heads/master@{#288948}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288948 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
sashab@chromium.org committed Aug 12, 2014
1 parent d9eb519 commit 4bfc582
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.h"

#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
#include "chrome/browser/ui/views/app_list/app_list_dialog_contents_view.h"
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h"
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.h"
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h"
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.h"
#include "chrome/browser/ui/views/constrained_window_views.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest.h"
#include "ui/app_list/app_list_constants.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
Expand All @@ -24,6 +27,13 @@
void ShowAppInfoDialog(AppListControllerDelegate* app_list_controller_delegate,
Profile* profile,
const extensions::Extension* app) {
UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialogOpenedForType",
app->GetType(),
extensions::Manifest::NUM_LOAD_TYPES);
UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialogOpenedForLocation",
app->location(),
extensions::Manifest::NUM_LOCATIONS);

gfx::NativeWindow app_list_window =
app_list_controller_delegate->GetAppListWindow();
DCHECK(app_list_window);
Expand Down
30 changes: 30 additions & 0 deletions tools/metrics/histograms/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,22 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>

<histogram name="Apps.AppInfoDialog.OpenedForLocation" enum="AppLocation">
<owner>sashab@chromium.org</owner>
<summary>
The location of the app that the dialog was opened for. This is gathered
each time the app info dialog is opened.
</summary>
</histogram>

<histogram name="Apps.AppInfoDialog.OpenedForType" enum="ExtensionType">
<owner>sashab@chromium.org</owner>
<summary>
The type of the app that the dialog was opened for. This is gathered each
time the app info dialog is opened.
</summary>
</histogram>

<histogram name="Apps.AppLaunch" enum="AppLaunch">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<summary>
Expand Down Expand Up @@ -36602,6 +36618,20 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="4" label="SEARCH_PEOPLE"/>
</enum>

<enum name="AppLocation" type="int">
<int value="0" label="Invalid location"/>
<int value="1" label="Internal extension"/>
<int value="2" label="Internal extension (loaded via prefs)"/>
<int value="3" label="Internal extension (loaded via the registry)"/>
<int value="4" label="Unpacked extension"/>
<int value="5" label="Component app"/>
<int value="6" label="External extension (downloaded via prefs)"/>
<int value="7" label="External extension (downloaded via admin policies)"/>
<int value="8" label="Command-line extension"/>
<int value="9" label="External extension (loaded via prefs and cached)"/>
<int value="10" label="Component app (downloaded)"/>
</enum>

<enum name="AppPromoAction" type="int">
<int value="0" label="PROMO_LAUNCH_APP"/>
<int value="1" label="PROMO_LAUNCH_WEB_STORE"/>
Expand Down

0 comments on commit 4bfc582

Please sign in to comment.