Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / ui / events / gestures / motion_event_aura.cc
index 6eea922..ab20860 100644 (file)
@@ -85,79 +85,50 @@ int MotionEventAura::GetActionIndex() const {
   DCHECK(cached_action_ == ACTION_POINTER_DOWN ||
          cached_action_ == ACTION_POINTER_UP);
   DCHECK_GE(cached_action_index_, 0);
-  DCHECK_LE(cached_action_index_, static_cast<int>(pointer_count_));
+  DCHECK_LT(cached_action_index_, static_cast<int>(pointer_count_));
   return cached_action_index_;
 }
 
 size_t MotionEventAura::GetPointerCount() const { return pointer_count_; }
 
 int MotionEventAura::GetPointerId(size_t pointer_index) const {
-  DCHECK_LE(pointer_index, pointer_count_);
+  DCHECK_LT(pointer_index, pointer_count_);
   return active_touches_[pointer_index].touch_id;
 }
 
 float MotionEventAura::GetX(size_t pointer_index) const {
-  DCHECK_LE(pointer_index, pointer_count_);
+  DCHECK_LT(pointer_index, pointer_count_);
   return active_touches_[pointer_index].x;
 }
 
 float MotionEventAura::GetY(size_t pointer_index) const {
-  DCHECK_LE(pointer_index, pointer_count_);
+  DCHECK_LT(pointer_index, pointer_count_);
   return active_touches_[pointer_index].y;
 }
 
 float MotionEventAura::GetRawX(size_t pointer_index) const {
-  DCHECK_LE(pointer_index, pointer_count_);
+  DCHECK_LT(pointer_index, pointer_count_);
   return active_touches_[pointer_index].raw_x;
 }
 
 float MotionEventAura::GetRawY(size_t pointer_index) const {
-  DCHECK_LE(pointer_index, pointer_count_);
+  DCHECK_LT(pointer_index, pointer_count_);
   return active_touches_[pointer_index].raw_y;
 }
 
 float MotionEventAura::GetTouchMajor(size_t pointer_index) const {
-  DCHECK_LE(pointer_index, pointer_count_);
+  DCHECK_LT(pointer_index, pointer_count_);
   return active_touches_[pointer_index].major_radius * 2;
 }
 
 float MotionEventAura::GetPressure(size_t pointer_index) const {
-  DCHECK_LE(pointer_index, pointer_count_);
+  DCHECK_LT(pointer_index, pointer_count_);
   return active_touches_[pointer_index].pressure;
 }
 
-base::TimeTicks MotionEventAura::GetEventTime() const {
-  return last_touch_time_;
-}
-
-size_t MotionEventAura::GetHistorySize() const { return 0; }
-
-base::TimeTicks MotionEventAura::GetHistoricalEventTime(
-    size_t historical_index) const {
-  NOTIMPLEMENTED();
-  return base::TimeTicks();
-}
-
-float MotionEventAura::GetHistoricalTouchMajor(size_t pointer_index,
-                                             size_t historical_index) const {
-  NOTIMPLEMENTED();
-  return 0;
-}
-
-float MotionEventAura::GetHistoricalX(size_t pointer_index,
-                                    size_t historical_index) const {
-  NOTIMPLEMENTED();
-  return 0;
-}
-
-float MotionEventAura::GetHistoricalY(size_t pointer_index,
-                                    size_t historical_index) const {
-  NOTIMPLEMENTED();
-  return 0;
-}
-
 MotionEvent::ToolType MotionEventAura::GetToolType(size_t pointer_index) const {
-  NOTIMPLEMENTED();
+  // TODO(jdduke): Plumb tool type from the platform, crbug.com/404128.
+  DCHECK_LT(pointer_index, pointer_count_);
   return MotionEvent::TOOL_TYPE_UNKNOWN;
 }
 
@@ -166,6 +137,10 @@ int MotionEventAura::GetButtonState() const {
   return 0;
 }
 
+base::TimeTicks MotionEventAura::GetEventTime() const {
+  return last_touch_time_;
+}
+
 scoped_ptr<MotionEvent> MotionEventAura::Clone() const {
   return scoped_ptr<MotionEvent>(new MotionEventAura(pointer_count_,
                                                      last_touch_time_,
@@ -201,7 +176,7 @@ MotionEventAura::PointData::PointData()
 }
 
 int MotionEventAura::GetSourceDeviceId(size_t pointer_index) const {
-  DCHECK_LE(pointer_index, pointer_count_);
+  DCHECK_LT(pointer_index, pointer_count_);
   return active_touches_[pointer_index].source_device_id;
 }
 
@@ -238,7 +213,7 @@ void MotionEventAura::UpdateCachedAction(const TouchEvent& touch) {
         cached_action_ = ACTION_POINTER_UP;
         cached_action_index_ =
             static_cast<int>(GetIndexFromId(touch.touch_id()));
-        DCHECK_LE(cached_action_index_, static_cast<int>(pointer_count_));
+        DCHECK_LT(cached_action_index_, static_cast<int>(pointer_count_));
       }
       break;
     case ET_TOUCH_CANCELLED: