diff options
author | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-24 00:37:25 +0000 |
---|---|---|
committer | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-24 00:37:25 +0000 |
commit | 25ce8e118923f7adc689e7a30d97cd90a0f4ff8e (patch) | |
tree | 71eb440634f6f777ac564487ad43636d87567589 /ash/wm | |
parent | a4fb16985904cdcb46ba0c2fd37ba3858bc2e264 (diff) | |
download | chromium_src-25ce8e118923f7adc689e7a30d97cd90a0f4ff8e.zip chromium_src-25ce8e118923f7adc689e7a30d97cd90a0f4ff8e.tar.gz chromium_src-25ce8e118923f7adc689e7a30d97cd90a0f4ff8e.tar.bz2 |
Adding UMA counters to ASH-WM functions like minimize, maximize, ...
BUG=154961
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11953036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm')
-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 |
3 files changed, 20 insertions, 0 deletions
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; |