Index: ash/touch/touch_uma.cc |
diff --git a/ash/touch/touch_uma.cc b/ash/touch/touch_uma.cc |
index bff116a0807d242c9995ed64bc38baaa00db3009..2eb85593eddfbbba6c3753aad4f32f5eba5b36ec 100644 |
--- a/ash/touch/touch_uma.cc |
+++ b/ash/touch/touch_uma.cc |
@@ -40,9 +40,7 @@ struct WindowTouchDetails { |
base::TimeTicks last_mt_time_; |
}; |
-DEFINE_OWNED_WINDOW_PROPERTY_KEY(WindowTouchDetails, |
- kWindowTouchDetails, |
- NULL); |
+DEFINE_OWNED_WINDOW_PROPERTY_KEY(WindowTouchDetails, kWindowTouchDetails, NULL); |
} |
DECLARE_WINDOW_PROPERTY_TYPE(WindowTouchDetails*); |
@@ -74,8 +72,7 @@ void TouchUMA::RecordGestureEvent(aura::Window* target, |
void TouchUMA::RecordGestureAction(GestureActionType action) { |
if (action == GESTURE_UNKNOWN || action >= GESTURE_ACTION_COUNT) |
return; |
- UMA_HISTOGRAM_ENUMERATION("Ash.GestureTarget", action, |
- GESTURE_ACTION_COUNT); |
+ UMA_HISTOGRAM_ENUMERATION("Ash.GestureTarget", action, GESTURE_ACTION_COUNT); |
} |
void TouchUMA::RecordTouchEvent(aura::Window* target, |
@@ -97,10 +94,10 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, |
// Record the location of the touch points. |
const int kBucketCountForLocation = 100; |
const gfx::Rect bounds = target->GetRootWindow()->bounds(); |
- const int bucket_size_x = std::max(1, |
- bounds.width() / kBucketCountForLocation); |
- const int bucket_size_y = std::max(1, |
- bounds.height() / kBucketCountForLocation); |
+ const int bucket_size_x = |
+ std::max(1, bounds.width() / kBucketCountForLocation); |
+ const int bucket_size_y = |
+ std::max(1, bounds.height() / kBucketCountForLocation); |
gfx::Point position = event.root_location(); |
@@ -114,12 +111,12 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, |
position.set_x(std::min(bounds.width() - 1, std::max(0, position.x()))); |
position.set_y(std::min(bounds.height() - 1, std::max(0, position.y()))); |
- UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchPositionX", |
- position.x() / bucket_size_x, |
- 0, kBucketCountForLocation, kBucketCountForLocation + 1); |
- UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchPositionY", |
- position.y() / bucket_size_y, |
- 0, kBucketCountForLocation, kBucketCountForLocation + 1); |
+ UMA_HISTOGRAM_CUSTOM_COUNTS( |
+ "Ash.TouchPositionX", position.x() / bucket_size_x, 0, |
+ kBucketCountForLocation, kBucketCountForLocation + 1); |
+ UMA_HISTOGRAM_CUSTOM_COUNTS( |
+ "Ash.TouchPositionY", position.y() / bucket_size_y, 0, |
+ kBucketCountForLocation, kBucketCountForLocation + 1); |
if (event.type() == ui::ET_TOUCH_PRESSED) { |
WmShell::Get()->RecordUserMetricsAction(UMA_TOUCHSCREEN_TAP_DOWN); |
@@ -137,31 +134,30 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, |
if (diff.InSeconds() > 30) { |
base::TimeDelta gap = event.time_stamp() - details->last_release_time_; |
UMA_HISTOGRAM_COUNTS_10000("Ash.TouchStartAfterEnd", |
- gap.InMilliseconds()); |
+ gap.InMilliseconds()); |
} |
} |
// Record the number of touch-points currently active for the window. |
const int kMaxTouchPoints = 10; |
UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.ActiveTouchPoints", |
- details->last_start_time_.size(), |
- 1, kMaxTouchPoints, kMaxTouchPoints + 1); |
+ details->last_start_time_.size(), 1, |
+ kMaxTouchPoints, kMaxTouchPoints + 1); |
} else if (event.type() == ui::ET_TOUCH_RELEASED) { |
if (details->last_start_time_.count(event.touch_id())) { |
- base::TimeDelta duration = event.time_stamp() - |
- details->last_start_time_[event.touch_id()]; |
+ base::TimeDelta duration = |
+ event.time_stamp() - details->last_start_time_[event.touch_id()]; |
// Look for touches that were [almost] stationary for a long time. |
const double kLongStationaryTouchDuration = 10; |
const int kLongStationaryTouchDistanceSquared = 100; |
if (duration.InSecondsF() > kLongStationaryTouchDuration) { |
- gfx::Vector2d distance = event.root_location() - |
+ gfx::Vector2d distance = |
+ event.root_location() - |
details->start_touch_position_[event.touch_id()]; |
if (distance.LengthSquared() < kLongStationaryTouchDistanceSquared) { |
UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.StationaryTouchDuration", |
- duration.InSeconds(), |
- kLongStationaryTouchDuration, |
- 1000, |
- 20); |
+ duration.InSeconds(), |
+ kLongStationaryTouchDuration, 1000, 20); |
} |
} |
} |
@@ -179,11 +175,10 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, |
} |
if (details->last_move_time_.count(event.touch_id())) { |
- base::TimeDelta move_delay = event.time_stamp() - |
- details->last_move_time_[event.touch_id()]; |
+ base::TimeDelta move_delay = |
+ event.time_stamp() - details->last_move_time_[event.touch_id()]; |
UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchMoveInterval", |
- move_delay.InMilliseconds(), |
- 1, 50, 25); |
+ move_delay.InMilliseconds(), 1, 50, 25); |
} |
UMA_HISTOGRAM_CUSTOM_COUNTS("Ash.TouchMoveSteps", distance, 1, 1000, 50); |
@@ -196,11 +191,9 @@ void TouchUMA::RecordTouchEvent(aura::Window* target, |
TouchUMA::TouchUMA() |
: is_single_finger_gesture_(false), |
touch_in_progress_(false), |
- burst_length_(0) { |
-} |
+ burst_length_(0) {} |
-TouchUMA::~TouchUMA() { |
-} |
+TouchUMA::~TouchUMA() {} |
void TouchUMA::UpdateTouchState(const ui::TouchEvent& event) { |
if (event.type() == ui::ET_TOUCH_PRESSED) { |
@@ -272,8 +265,8 @@ TouchUMA::GestureActionType TouchUMA::FindGestureActionType( |
if (!widget->GetRootView()) |
return GESTURE_UNKNOWN; |
- views::View* view = widget->GetRootView()-> |
- GetEventHandlerForPoint(event.location()); |
+ views::View* view = |
+ widget->GetRootView()->GetEventHandlerForPoint(event.location()); |
if (!view) |
return GESTURE_UNKNOWN; |