diff options
author | tdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-29 01:44:35 +0000 |
---|---|---|
committer | tdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-29 01:44:35 +0000 |
commit | c146a323f91c8376afe55c93c6a31df0075be62b (patch) | |
tree | ce354d74ecacdeaf81199bb5c6b8a8231d668284 /ash/wm | |
parent | 9c1df29797fa40a1902b21435960710c16ec619c (diff) | |
download | chromium_src-c146a323f91c8376afe55c93c6a31df0075be62b.zip chromium_src-c146a323f91c8376afe55c93c6a31df0075be62b.tar.gz chromium_src-c146a323f91c8376afe55c93c6a31df0075be62b.tar.bz2 |
Add UMA metrics to measure the effectiveness of views fuzzing
Add new buckets to the Ash.GestureTarget histogram which
will be useful in measuring the effectiveness of views
fuzzing when it is implemented. The idea is to count taps
made on the different element types located on/near the
tab strip. A description of the new types added to
GestureActionType in touch_uma.cc:
GESTURE_TABSWITCH_TAP: A tap on a currently unselected
tab (i.e., the tap was responsible for selecting the tab).
GESTURE_TABNOSWITCH_TAP: A tap on a currently selected
tab (i.e, the tap had no visible effect).
GESTURE_TABCLOSE_TAP: A tap on a tab's close button.
GESTURE_NEWTAB_TAP: A tap on the new tab button.
GESTURE_FRAMEMAXIMIZE_TAP: A tap on the frame maximize
button.
GESTURE_FRAMEVIEW_TAP: A tap on the space to the right of
the tabstrip, left of the tabstrip, or in between tabs.
Such a tap has no visible effect.
GESTURE_ROOTVIEWTOP_TAP: A tap on the top edge of a browser
window. Such a tap has no visible effect.
GESTURE_MAXIMIZE_DOUBLETAP: A double-tap on the browser
window resulting in a maximize or restore action.
BUG=248230
Review URL: https://chromiumcodereview.appspot.com/16832003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm')
-rw-r--r-- | ash/wm/system_gesture_event_filter.cc | 4 | ||||
-rw-r--r-- | ash/wm/system_gesture_event_filter.h | 2 | ||||
-rw-r--r-- | ash/wm/workspace/frame_maximize_button.cc | 6 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_event_handler.cc | 22 |
4 files changed, 23 insertions, 11 deletions
diff --git a/ash/wm/system_gesture_event_filter.cc b/ash/wm/system_gesture_event_filter.cc index c20b082..b368822 100644 --- a/ash/wm/system_gesture_event_filter.cc +++ b/ash/wm/system_gesture_event_filter.cc @@ -64,13 +64,13 @@ void SystemGestureEventFilter::OnMouseEvent(ui::MouseEvent* event) { void SystemGestureEventFilter::OnTouchEvent(ui::TouchEvent* event) { aura::Window* target = static_cast<aura::Window*>(event->target()); - touch_uma_.RecordTouchEvent(target, *event); + ash::TouchUMA::GetInstance()->RecordTouchEvent(target, *event); long_press_affordance_->ProcessEvent(target, event, event->touch_id()); } void SystemGestureEventFilter::OnGestureEvent(ui::GestureEvent* event) { aura::Window* target = static_cast<aura::Window*>(event->target()); - touch_uma_.RecordGestureEvent(target, *event); + ash::TouchUMA::GetInstance()->RecordGestureEvent(target, *event); long_press_affordance_->ProcessEvent(target, event, event->GetLowestTouchId()); diff --git a/ash/wm/system_gesture_event_filter.h b/ash/wm/system_gesture_event_filter.h index 8aaabec..a2a5c73 100644 --- a/ash/wm/system_gesture_event_filter.h +++ b/ash/wm/system_gesture_event_filter.h @@ -69,8 +69,6 @@ class SystemGestureEventFilter : public ui::EventHandler, scoped_ptr<LongPressAffordanceHandler> long_press_affordance_; scoped_ptr<TwoFingerDragHandler> two_finger_drag_; - TouchUMA touch_uma_; - DISALLOW_COPY_AND_ASSIGN(SystemGestureEventFilter); }; diff --git a/ash/wm/workspace/frame_maximize_button.cc b/ash/wm/workspace/frame_maximize_button.cc index 0329e3f..23ca750 100644 --- a/ash/wm/workspace/frame_maximize_button.cc +++ b/ash/wm/workspace/frame_maximize_button.cc @@ -9,6 +9,7 @@ #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" #include "ash/shell_delegate.h" +#include "ash/touch/touch_uma.h" #include "ash/wm/maximize_bubble_controller.h" #include "ash/wm/property_util.h" #include "ash/wm/window_properties.h" @@ -279,8 +280,11 @@ void FrameMaximizeButton::OnGestureEvent(ui::GestureEvent* event) { // for TAP and SCROLL_END). So it is necessary to update the snap-state for // the current event. ProcessUpdateEvent(*event); - if (event->type() == ui::ET_GESTURE_TAP) + if (event->type() == ui::ET_GESTURE_TAP) { snap_type_ = SnapTypeForLocation(event->location()); + TouchUMA::GetInstance()->RecordGestureAction( + TouchUMA::GESTURE_FRAMEMAXIMIZE_TAP); + } ProcessEndEvent(*event); event->SetHandled(); return; diff --git a/ash/wm/workspace/workspace_event_handler.cc b/ash/wm/workspace/workspace_event_handler.cc index 828f024..6bf384c 100644 --- a/ash/wm/workspace/workspace_event_handler.cc +++ b/ash/wm/workspace/workspace_event_handler.cc @@ -7,6 +7,7 @@ #include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/shell_delegate.h" +#include "ash/touch/touch_uma.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/property_util.h" #include "ash/wm/window_util.h" @@ -119,14 +120,23 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) { void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) { aura::Window* target = static_cast<aura::Window*>(event->target()); if (event->type() == ui::ET_GESTURE_TAP && - event->details().tap_count() == 2 && 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; + if (event->details().tap_count() == 2) { + ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction( + ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE); + // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice each time + // TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP is counted once. + TouchUMA::GetInstance()->RecordGestureAction( + TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP); + ToggleMaximizedState(target); // |this| may be destroyed from here. + event->StopPropagation(); + return; + } else { + // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice for each tap. + TouchUMA::GetInstance()->RecordGestureAction( + TouchUMA::GESTURE_FRAMEVIEW_TAP); + } } ToplevelWindowEventHandler::OnGestureEvent(event); } |