summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ash/accelerators/accelerator_controller.cc2
-rw-r--r--ash/shell_delegate.h20
-rw-r--r--ash/wm/custom_frame_view_ash.cc16
-rw-r--r--ash/wm/maximize_bubble_controller.cc2
-rw-r--r--ash/wm/workspace/frame_maximize_button.cc13
-rw-r--r--chrome/browser/ui/ash/chrome_shell_delegate.cc60
-rw-r--r--chrome/browser/ui/ash/launcher/launcher_context_menu.cc4
-rw-r--r--chrome/browser/ui/browser_command_controller.cc2
-rw-r--r--chrome/browser/ui/toolbar/wrench_menu_model.cc7
-rw-r--r--chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc7
-rw-r--r--chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc21
11 files changed, 118 insertions, 36 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 3728d43..9face4f 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -780,6 +780,8 @@ bool AcceleratorController::PerformAction(int action,
// crbug.com/131709, which is a crashing issue related to minimizing
// full screen pepper window.
if (!wm::IsWindowFullscreen(window) && wm::CanMinimizeWindow(window)) {
+ ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction(
+ ash::UMA_MINIMIZE_PER_KEY);
wm::MinimizeWindow(window);
return true;
}
diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h
index e57eebd..ce1c3a1 100644
--- a/ash/shell_delegate.h
+++ b/ash/shell_delegate.h
@@ -62,14 +62,10 @@ enum UserMetricsAction {
UMA_ACCEL_PREVWINDOW_TAB,
UMA_ACCEL_SEARCH_LWIN,
UMA_ACCEL_SHUT_DOWN_POWER_BUTTON,
- UMA_MAXIMIZE_BUTTON_MAXIMIZE,
- UMA_MAXIMIZE_BUTTON_MAXIMIZE_LEFT,
- UMA_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT,
- UMA_MAXIMIZE_BUTTON_MINIMIZE,
- UMA_MAXIMIZE_BUTTON_RESTORE,
- UMA_MAXIMIZE_BUTTON_SHOW_BUBBLE,
+ UMA_CLOSE_THROUGH_CONTEXT_MENU,
UMA_LAUNCHER_CLICK_ON_APP,
UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON,
+ UMA_MINIMIZE_PER_KEY,
UMA_MOUSE_DOWN,
UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK,
UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE,
@@ -77,6 +73,18 @@ enum UserMetricsAction {
UMA_TRAY_HELP,
UMA_TRAY_LOCK_SCREEN,
UMA_TRAY_SHUT_DOWN,
+ UMA_WINDOW_APP_CLOSE_BUTTON_CLICK,
+ UMA_WINDOW_CLOSE_BUTTON_CLICK,
+ UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN,
+ UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE,
+ UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE,
+ UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE,
+ UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE,
+ UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT,
+ UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT,
+ UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE,
+ UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE,
+ UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE,
};
enum AccessibilityNotificationVisibility {
diff --git a/ash/wm/custom_frame_view_ash.cc b/ash/wm/custom_frame_view_ash.cc
index 6350e9a..72c62ee 100644
--- a/ash/wm/custom_frame_view_ash.cc
+++ b/ash/wm/custom_frame_view_ash.cc
@@ -4,6 +4,7 @@
#include "ash/wm/custom_frame_view_ash.h"
+#include "ash/shell_delegate.h"
#include "ash/wm/frame_painter.h"
#include "ash/wm/workspace/frame_maximize_button.h"
#include "grit/ash_resources.h"
@@ -170,17 +171,28 @@ void CustomFrameViewAsh::ButtonPressed(views::Button* sender,
slow_duration_mode.reset(new ui::ScopedAnimationDurationScaleMode(
ui::ScopedAnimationDurationScaleMode::SLOW_DURATION));
}
+
+ ash::UserMetricsAction action =
+ ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE;
+
if (sender == maximize_button_) {
// The maximize button may move out from under the cursor.
ResetWindowControls();
- if (frame_->IsMaximized())
+ if (frame_->IsMaximized()) {
+ action = ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE;
frame_->Restore();
- else
+ } else {
frame_->Maximize();
+ }
// |this| may be deleted - some windows delete their frames on maximize.
} else if (sender == close_button_) {
+ action = ash::UMA_WINDOW_CLOSE_BUTTON_CLICK;
frame_->Close();
+ } else {
+ return;
}
+
+ ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction(action);
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/ash/wm/maximize_bubble_controller.cc b/ash/wm/maximize_bubble_controller.cc
index fa5b2ed..3913546 100644
--- a/ash/wm/maximize_bubble_controller.cc
+++ b/ash/wm/maximize_bubble_controller.cc
@@ -429,7 +429,7 @@ MaximizeBubbleController::Bubble::Bubble(
StartFade(true);
ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction(
- ash::UMA_MAXIMIZE_BUTTON_SHOW_BUBBLE);
+ ash::UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE);
mouse_watcher_.reset(new views::MouseWatcher(
new BubbleMouseWatcherHost(this),
diff --git a/ash/wm/workspace/frame_maximize_button.cc b/ash/wm/workspace/frame_maximize_button.cc
index c7dd3bd..a6262f9 100644
--- a/ash/wm/workspace/frame_maximize_button.cc
+++ b/ash/wm/workspace/frame_maximize_button.cc
@@ -514,8 +514,9 @@ void FrameMaximizeButton::Snap(const SnapSizer& snap_sizer) {
case SNAP_LEFT:
case SNAP_RIGHT: {
shell->delegate()->RecordUserMetricsAction(
- snap_type_ == SNAP_LEFT ? ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE_LEFT :
- ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT);
+ snap_type_ == SNAP_LEFT ?
+ ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT :
+ ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT);
// Get the bounds in screen coordinates for restore purposes.
gfx::Rect restore = widget->GetWindowBoundsInScreen();
if (widget->IsMaximized() || widget->IsFullscreen()) {
@@ -558,17 +559,17 @@ void FrameMaximizeButton::Snap(const SnapSizer& snap_sizer) {
case SNAP_MAXIMIZE:
widget->Maximize();
shell->delegate()->RecordUserMetricsAction(
- ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE);
+ ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE);
break;
case SNAP_MINIMIZE:
widget->Minimize();
shell->delegate()->RecordUserMetricsAction(
- ash::UMA_MAXIMIZE_BUTTON_MINIMIZE);
+ ash::UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE);
break;
case SNAP_RESTORE:
widget->Restore();
shell->delegate()->RecordUserMetricsAction(
- ash::UMA_MAXIMIZE_BUTTON_RESTORE);
+ ash::UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE);
break;
case SNAP_NONE:
NOTREACHED();
@@ -576,7 +577,7 @@ void FrameMaximizeButton::Snap(const SnapSizer& snap_sizer) {
}
MaximizeBubbleFrameState
- FrameMaximizeButton::GetMaximizeBubbleFrameState() const {
+FrameMaximizeButton::GetMaximizeBubbleFrameState() const {
// When there are no restore bounds, we are in normal mode.
if (!ash::GetRestoreBoundsInScreen(
frame_->GetWidget()->GetNativeWindow()))
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index 58b9aea..5d408ce 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -251,23 +251,8 @@ void ChromeShellDelegate::RecordUserMetricsAction(
content::RecordAction(
content::UserMetricsAction("Accel_ShutDown_PowerButton"));
break;
- case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE:
- content::RecordAction(content::UserMetricsAction("MaxButton_Maximize"));
- break;
- case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE_LEFT:
- content::RecordAction(content::UserMetricsAction("MaxButton_MaxLeft"));
- break;
- case ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT:
- content::RecordAction(content::UserMetricsAction("MaxButton_MaxRight"));
- break;
- case ash::UMA_MAXIMIZE_BUTTON_MINIMIZE:
- content::RecordAction(content::UserMetricsAction("MaxButton_Minimize"));
- break;
- case ash::UMA_MAXIMIZE_BUTTON_RESTORE:
- content::RecordAction(content::UserMetricsAction("MaxButton_Restore"));
- break;
- case ash::UMA_MAXIMIZE_BUTTON_SHOW_BUBBLE:
- content::RecordAction(content::UserMetricsAction("MaxButton_ShowBubble"));
+ case ash::UMA_CLOSE_THROUGH_CONTEXT_MENU:
+ content::RecordAction(content::UserMetricsAction("CloseFromContextMenu"));
break;
case ash::UMA_LAUNCHER_CLICK_ON_APP:
content::RecordAction(content::UserMetricsAction("Launcher_ClickOnApp"));
@@ -276,6 +261,9 @@ void ChromeShellDelegate::RecordUserMetricsAction(
content::RecordAction(
content::UserMetricsAction("Launcher_ClickOnApplistButton"));
break;
+ case ash::UMA_MINIMIZE_PER_KEY:
+ content::RecordAction(content::UserMetricsAction("Minimize_UsingKey"));
+ break;
case ash::UMA_MOUSE_DOWN:
content::RecordAction(content::UserMetricsAction("Mouse_Down"));
break;
@@ -299,6 +287,44 @@ void ChromeShellDelegate::RecordUserMetricsAction(
case ash::UMA_TRAY_SHUT_DOWN:
content::RecordAction(content::UserMetricsAction("Tray_ShutDown"));
break;
+ case ash::UMA_WINDOW_APP_CLOSE_BUTTON_CLICK:
+ content::RecordAction(content::UserMetricsAction("AppCloseButton_Clk"));
+ break;
+ case ash::UMA_WINDOW_CLOSE_BUTTON_CLICK:
+ content::RecordAction(content::UserMetricsAction("CloseButton_Clk"));
+ break;
+ case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN:
+ content::RecordAction(content::UserMetricsAction("MaxButton_Clk_ExitFS"));
+ break;
+ case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE:
+ content::RecordAction(
+ content::UserMetricsAction("MaxButton_Clk_Restore"));
+ break;
+ case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE:
+ content::RecordAction(
+ content::UserMetricsAction("MaxButton_Clk_Maximize"));
+ break;
+ case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE:
+ content::RecordAction(content::UserMetricsAction("MinButton_Clk"));
+ break;
+ case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE:
+ content::RecordAction(content::UserMetricsAction("MaxButton_Maximize"));
+ break;
+ case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT:
+ content::RecordAction(content::UserMetricsAction("MaxButton_MaxLeft"));
+ break;
+ case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT:
+ content::RecordAction(content::UserMetricsAction("MaxButton_MaxRight"));
+ break;
+ case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE:
+ content::RecordAction(content::UserMetricsAction("MaxButton_Minimize"));
+ break;
+ case ash::UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE:
+ content::RecordAction(content::UserMetricsAction("MaxButton_Restore"));
+ break;
+ case ash::UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE:
+ content::RecordAction(content::UserMetricsAction("MaxButton_ShowBubble"));
+ break;
}
}
diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
index 8a79bd4..0fcbf0f 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
@@ -9,6 +9,7 @@
#include "ash/desktop_background/user_wallpaper_delegate.h"
#include "ash/root_window_controller.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/wm/property_util.h"
#include "base/bind.h"
#include "base/command_line.h"
@@ -17,6 +18,7 @@
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/ash/chrome_shell_delegate.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/common/context_menu_params.h"
@@ -239,6 +241,8 @@ void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) {
break;
case MENU_CLOSE:
controller_->Close(item_.id);
+ ChromeShellDelegate::instance()->RecordUserMetricsAction(
+ ash::UMA_CLOSE_THROUGH_CONTEXT_MENU);
break;
case MENU_PIN:
controller_->TogglePinned(item_.id);
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index fee9757..6930c5e 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -376,12 +376,14 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
NewIncognitoWindow(browser_);
break;
case IDC_CLOSE_WINDOW:
+ content::RecordAction(content::UserMetricsAction("CloseWindowByKey"));
CloseWindow(browser_);
break;
case IDC_NEW_TAB:
NewTab(browser_);
break;
case IDC_CLOSE_TAB:
+ content::RecordAction(content::UserMetricsAction("CloseTabByKey"));
CloseTab(browser_);
break;
case IDC_SELECT_NEXT_TAB:
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 8c690e7..d8ae5ad 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -377,6 +377,13 @@ void WrenchMenuModel::ExecuteCommand(int command_id, int event_flags) {
if (command_id == IDC_HELP_PAGE_VIA_MENU)
content::RecordAction(UserMetricsAction("ShowHelpTabViaWrenchMenu"));
+ if (command_id == IDC_FULLSCREEN) {
+ // We issue the UMA command here and not in BrowserCommandController or even
+ // FullscreenController since we want to be able to distinguish this event
+ // and a menu which is under development.
+ content::RecordAction(UserMetricsAction("EnterFullScreenWithWrenchMenu"));
+ }
+
chrome::ExecuteCommand(browser_, command_id);
}
diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc
index 51e30ab..2b1bfa7 100644
--- a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc
@@ -4,9 +4,11 @@
#include "chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h"
+#include "ash/shell_delegate.h"
#include "ash/wm/workspace/frame_maximize_button.h"
#include "base/debug/stack_trace.h"
#include "base/i18n/rtl.h"
+#include "chrome/browser/ui/ash/chrome_shell_delegate.h"
#include "chrome/browser/ui/views/frame/browser_frame.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "grit/ash_resources.h"
@@ -108,12 +110,17 @@ class AppNonClientFrameViewAsh::ControlView
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE {
+ ash::UserMetricsAction action = ash::UMA_WINDOW_APP_CLOSE_BUTTON_CLICK;
if (sender == close_button_) {
owner_->frame()->Close();
} else if (sender == restore_button_) {
+ action = ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE;
restore_button_->SetState(views::CustomButton::STATE_NORMAL);
owner_->frame()->Restore();
+ } else {
+ return;
}
+ ChromeShellDelegate::instance()->RecordUserMetricsAction(action);
}
// Returns the insets of the control which are only covered by the shadow.
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
index db914ec..7955e18 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -4,9 +4,11 @@
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h"
+#include "ash/shell_delegate.h"
#include "ash/wm/frame_painter.h"
#include "ash/wm/workspace/frame_maximize_button.h"
#include "chrome/browser/themes/theme_properties.h"
+#include "chrome/browser/ui/ash/chrome_shell_delegate.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/views/avatar_menu_button.h"
#include "chrome/browser/ui/views/frame/browser_frame.h"
@@ -292,21 +294,32 @@ void BrowserNonClientFrameViewAsh::ButtonPressed(views::Button* sender,
ui::ScopedAnimationDurationScaleMode::SLOW_DURATION));
}
+ ash::UserMetricsAction action =
+ ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE;
+
if (sender == size_button_) {
// The maximize button may move out from under the cursor.
ResetWindowControls();
- if (size_button_minimizes_)
+ if (size_button_minimizes_) {
frame()->Minimize();
- else if (frame()->IsFullscreen()) // Can be clicked in immersive mode.
+ action = ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE;
+ } else if (frame()->IsFullscreen()) { // Can be clicked in immersive mode.
frame()->SetFullscreen(false);
- else if (frame()->IsMaximized())
+ action = ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN;
+ } else if (frame()->IsMaximized()) {
frame()->Restore();
- else
+ action = ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE;
+ } else {
frame()->Maximize();
+ }
// |this| may be deleted - some windows delete their frames on maximize.
} else if (sender == close_button_) {
frame()->Close();
+ action = ash::UMA_WINDOW_CLOSE_BUTTON_CLICK;
+ } else {
+ return;
}
+ ChromeShellDelegate::instance()->RecordUserMetricsAction(action);
}
///////////////////////////////////////////////////////////////////////////////