Commit 9bfe548e authored by xiyuan@chromium.org's avatar xiyuan@chromium.org

chromeos: Add UMA stats for launcher and app list.

Add the following UMA stats:
- Launcher_ClickOnAppListButton
  Count clicks on launcher's app list button.
- Launcher_ClickOnApp
  Count clicks on apps in launcher bar (including Chrome).
- AppList_ClickOnApp
  Count clicks on apps in app list bubble.
- AppList_Search
  Count search + open result in app list.
- AppList_ClickOnAppFromSearch
  Count clicks on apps in app list search results.

BUG=137358
TEST=Verify the added UMA stats work as expected.

R=sky@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10832247

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151156 0039d316-1c4b-4281-b951-d872f2087c98
parent a84030b4
...@@ -1009,16 +1009,27 @@ void LauncherView::ButtonPressed(views::Button* sender, ...@@ -1009,16 +1009,27 @@ void LauncherView::ButtonPressed(views::Button* sender,
switch (model_->items()[view_index].type) { switch (model_->items()[view_index].type) {
case TYPE_TABBED: case TYPE_TABBED:
case TYPE_APP_PANEL: case TYPE_APP_PANEL:
delegate_->ItemClicked(model_->items()[view_index], event.flags());
break;
case TYPE_APP_SHORTCUT: case TYPE_APP_SHORTCUT:
case TYPE_PLATFORM_APP: case TYPE_PLATFORM_APP:
Shell::GetInstance()->delegate()->RecordUserMetricsAction(
UMA_LAUNCHER_CLICK_ON_APP);
delegate_->ItemClicked(model_->items()[view_index], event.flags()); delegate_->ItemClicked(model_->items()[view_index], event.flags());
break; break;
case TYPE_APP_LIST: case TYPE_APP_LIST:
Shell::GetInstance()->delegate()->RecordUserMetricsAction(
UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON);
Shell::GetInstance()->ToggleAppList(); Shell::GetInstance()->ToggleAppList();
break; break;
case TYPE_BROWSER_SHORTCUT: case TYPE_BROWSER_SHORTCUT:
// Click on browser icon is counted in app clicks.
Shell::GetInstance()->delegate()->RecordUserMetricsAction(
UMA_LAUNCHER_CLICK_ON_APP);
if (event.flags() & ui::EF_CONTROL_DOWN) if (event.flags() & ui::EF_CONTROL_DOWN)
delegate_->CreateNewWindow(); delegate_->CreateNewWindow();
else else
......
...@@ -37,12 +37,14 @@ class SystemTrayDelegate; ...@@ -37,12 +37,14 @@ class SystemTrayDelegate;
class UserWallpaperDelegate; class UserWallpaperDelegate;
enum UserMetricsAction { enum UserMetricsAction {
UMA_ACCEL_PREVWINDOW_TAB, UMA_ACCEL_NEWTAB_T,
UMA_ACCEL_NEXTWINDOW_F5,
UMA_ACCEL_NEXTWINDOW_TAB, UMA_ACCEL_NEXTWINDOW_TAB,
UMA_ACCEL_PREVWINDOW_F5, UMA_ACCEL_PREVWINDOW_F5,
UMA_ACCEL_NEXTWINDOW_F5, UMA_ACCEL_PREVWINDOW_TAB,
UMA_ACCEL_NEWTAB_T,
UMA_ACCEL_SEARCH_LWIN, UMA_ACCEL_SEARCH_LWIN,
UMA_LAUNCHER_CLICK_ON_APP,
UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON,
UMA_MOUSE_DOWN, UMA_MOUSE_DOWN,
UMA_TOUCHSCREEN_TAP_DOWN, UMA_TOUCHSCREEN_TAP_DOWN,
}; };
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "chrome/browser/ui/ash/app_list/apps_model_builder.h" #include "chrome/browser/ui/ash/app_list/apps_model_builder.h"
#include "chrome/browser/ui/ash/app_list/chrome_app_list_item.h" #include "chrome/browser/ui/ash/app_list/chrome_app_list_item.h"
#include "chrome/browser/ui/ash/app_list/search_builder.h" #include "chrome/browser/ui/ash/app_list/search_builder.h"
#include "content/public/browser/user_metrics.h"
AppListViewDelegate::AppListViewDelegate() { AppListViewDelegate::AppListViewDelegate() {
} }
...@@ -34,6 +35,7 @@ void AppListViewDelegate::SetModel(app_list::AppListModel* model) { ...@@ -34,6 +35,7 @@ void AppListViewDelegate::SetModel(app_list::AppListModel* model) {
void AppListViewDelegate::ActivateAppListItem( void AppListViewDelegate::ActivateAppListItem(
app_list::AppListItemModel* item, app_list::AppListItemModel* item,
int event_flags) { int event_flags) {
content::RecordAction(content::UserMetricsAction("AppList_ClickOnApp"));
static_cast<ChromeAppListItem*>(item)->Activate(event_flags); static_cast<ChromeAppListItem*>(item)->Activate(event_flags);
} }
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "chrome/common/extensions/extension_icon_set.h" #include "chrome/common/extensions/extension_icon_set.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
#include "grit/theme_resources.h" #include "grit/theme_resources.h"
#include "ui/app_list/app_list_switches.h" #include "ui/app_list/app_list_switches.h"
...@@ -232,11 +233,17 @@ void SearchBuilder::OpenResult(const app_list::SearchResult& result, ...@@ -232,11 +233,17 @@ void SearchBuilder::OpenResult(const app_list::SearchResult& result,
static_cast<const SearchBuilderResult*>(&result); static_cast<const SearchBuilderResult*>(&result);
const AutocompleteMatch& match = builder_result->match(); const AutocompleteMatch& match = builder_result->match();
// Count AppList.Search here because it is composed of search + action.
content::RecordAction(content::UserMetricsAction("AppList_Search"));
if (match.type == AutocompleteMatch::EXTENSION_APP) { if (match.type == AutocompleteMatch::EXTENSION_APP) {
const extensions::Extension* extension = const extensions::Extension* extension =
GetExtensionByURL(profile_, match.destination_url); GetExtensionByURL(profile_, match.destination_url);
if (extension) if (extension) {
content::RecordAction(
content::UserMetricsAction("AppList_ClickOnAppFromSearch"));
extension_utils::OpenExtension(profile_, extension, event_flags); extension_utils::OpenExtension(profile_, extension, event_flags);
}
} else { } else {
WindowOpenDisposition disposition = WindowOpenDisposition disposition =
chrome::DispositionFromEventFlags(event_flags); chrome::DispositionFromEventFlags(event_flags);
......
...@@ -353,6 +353,13 @@ void ChromeShellDelegate::RecordUserMetricsAction( ...@@ -353,6 +353,13 @@ void ChromeShellDelegate::RecordUserMetricsAction(
case ash::UMA_TOUCHSCREEN_TAP_DOWN: case ash::UMA_TOUCHSCREEN_TAP_DOWN:
content::RecordAction(content::UserMetricsAction("Touchscreen_Down")); content::RecordAction(content::UserMetricsAction("Touchscreen_Down"));
break; break;
case ash::UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON:
content::RecordAction(
content::UserMetricsAction("Launcher_ClickOnApplistButton"));
break;
case ash::UMA_LAUNCHER_CLICK_ON_APP:
content::RecordAction(content::UserMetricsAction("Launcher_ClickOnApp"));
break;
} }
} }
......
...@@ -69,6 +69,9 @@ ...@@ -69,6 +69,9 @@
0x649461e26c8e5796 AcceptedGeneratedKeyword 0x649461e26c8e5796 AcceptedGeneratedKeyword
0x2b6ed5e3f78e1295 AcceptedKeyword 0x2b6ed5e3f78e1295 AcceptedKeyword
0xaa16d48a61361aa6 AcceptedKeywordHint 0xaa16d48a61361aa6 AcceptedKeywordHint
0xfc0c75574fa0f498 AppList_ClickOnApp
0x73d7010c18cf1912 AppList_ClickOnAppFromSearch
0xdd57b39909cb275a AppList_Search
0x9ff9ef57d8d1d87c AutoDetectChange 0x9ff9ef57d8d1d87c AutoDetectChange
0x0557fa923dcee4d0 Back 0x0557fa923dcee4d0 Back
0xc66d44d8107c5f5d BackColor 0xc66d44d8107c5f5d BackColor
...@@ -899,6 +902,8 @@ ...@@ -899,6 +902,8 @@
0xbee911865b93d504 LanguageOptions_UiLanguageChange_zh-CN 0xbee911865b93d504 LanguageOptions_UiLanguageChange_zh-CN
0x03a61bc8bd6c791b LanguageOptions_UiLanguageChange_zh-TW 0x03a61bc8bd6c791b LanguageOptions_UiLanguageChange_zh-TW
0xd93d87f83683d666 LanguageOptions_UiLanguageChange_zu 0xd93d87f83683d666 LanguageOptions_UiLanguageChange_zu
0x7f28f030259fc65e Launcher_ClickOnApp
0x2df1e564b9b0952f Launcher_ClickOnApplistButton
0x384a6609143bbcae LoadURL 0x384a6609143bbcae LoadURL
0xe009e92f3909009c LoadURLFromKeyword 0xe009e92f3909009c LoadURLFromKeyword
0x795fc04747be6afa LockScreen 0x795fc04747be6afa LockScreen
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment