diff options
Diffstat (limited to 'ash')
-rw-r--r-- | ash/shell_delegate.h | 8 | ||||
-rw-r--r-- | ash/wm/maximize_bubble_controller.cc | 4 | ||||
-rw-r--r-- | ash/wm/workspace/frame_maximize_button.cc | 11 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_event_handler.cc | 5 |
4 files changed, 28 insertions, 0 deletions
diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h index 11482d5..c8d7b0d 100644 --- a/ash/shell_delegate.h +++ b/ash/shell_delegate.h @@ -54,9 +54,17 @@ enum UserMetricsAction { UMA_ACCEL_PREVWINDOW_F5, UMA_ACCEL_PREVWINDOW_TAB, UMA_ACCEL_SEARCH_LWIN, + 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_LAUNCHER_CLICK_ON_APP, UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON, UMA_MOUSE_DOWN, + UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK, + UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE, UMA_TOUCHSCREEN_TAP_DOWN, }; diff --git a/ash/wm/maximize_bubble_controller.cc b/ash/wm/maximize_bubble_controller.cc index ee8ffcb..d212bca 100644 --- a/ash/wm/maximize_bubble_controller.cc +++ b/ash/wm/maximize_bubble_controller.cc @@ -5,6 +5,7 @@ #include "ash/wm/maximize_bubble_controller.h" #include "ash/shell.h" +#include "ash/shell_delegate.h" #include "ash/shell_window_ids.h" #include "ash/wm/window_animations.h" #include "ash/wm/workspace/frame_maximize_button.h" @@ -427,6 +428,9 @@ MaximizeBubbleController::Bubble::Bubble( else StartFade(true); + ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction( + ash::UMA_MAXIMIZE_BUTTON_SHOW_BUBBLE); + mouse_watcher_.reset(new views::MouseWatcher( new BubbleMouseWatcherHost(this), this)); diff --git a/ash/wm/workspace/frame_maximize_button.cc b/ash/wm/workspace/frame_maximize_button.cc index bf25172..3aaf3d5 100644 --- a/ash/wm/workspace/frame_maximize_button.cc +++ b/ash/wm/workspace/frame_maximize_button.cc @@ -7,6 +7,7 @@ #include "ash/launcher/launcher.h" #include "ash/screen_ash.h" #include "ash/shell.h" +#include "ash/shell_delegate.h" #include "ash/wm/maximize_bubble_controller.h" #include "ash/wm/property_util.h" #include "ash/wm/workspace/phantom_window_controller.h" @@ -490,10 +491,14 @@ gfx::Point FrameMaximizeButton::LocationForSnapSizer( } void FrameMaximizeButton::Snap(const SnapSizer& snap_sizer) { + ash::Shell* shell = ash::Shell::GetInstance(); views::Widget* widget = frame_->GetWidget(); switch (snap_type_) { 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); // Get the bounds in screen coordinates for restore purposes. gfx::Rect restore = widget->GetWindowBoundsInScreen(); if (widget->IsMaximized()) { @@ -521,12 +526,18 @@ void FrameMaximizeButton::Snap(const SnapSizer& snap_sizer) { } case SNAP_MAXIMIZE: widget->Maximize(); + shell->delegate()->RecordUserMetricsAction( + ash::UMA_MAXIMIZE_BUTTON_MAXIMIZE); break; case SNAP_MINIMIZE: widget->Minimize(); + shell->delegate()->RecordUserMetricsAction( + ash::UMA_MAXIMIZE_BUTTON_MINIMIZE); break; case SNAP_RESTORE: widget->Restore(); + shell->delegate()->RecordUserMetricsAction( + ash::UMA_MAXIMIZE_BUTTON_RESTORE); break; case SNAP_NONE: NOTREACHED(); diff --git a/ash/wm/workspace/workspace_event_handler.cc b/ash/wm/workspace/workspace_event_handler.cc index 5e1a8a6..9ff19d2 100644 --- a/ash/wm/workspace/workspace_event_handler.cc +++ b/ash/wm/workspace/workspace_event_handler.cc @@ -6,6 +6,7 @@ #include "ash/screen_ash.h" #include "ash/shell.h" +#include "ash/shell_delegate.h" #include "ash/wm/property_util.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace/workspace_window_resizer.h" @@ -93,6 +94,8 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) { HTCAPTION) { bool destroyed = false; destroyed_ = &destroyed; + ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction( + ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK); ToggleMaximizedState(target); if (destroyed) return; @@ -113,6 +116,8 @@ void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) { if (event->type() == ui::ET_GESTURE_DOUBLE_TAP && target->delegate()->GetNonClientComponent(event->location()) == HTCAPTION) { + ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction( + ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE); ToggleMaximizedState(target); // |this| may be destroyed from here. event->StopPropagation(); return; |