1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "ui/base/events/event_utils.h" 6 7 #include "ui/base/events/event.h" 8 9 namespace ui { 10 11 namespace { 12 int g_custom_event_types = ET_LAST; 13 } // namespace 14 15 bool EventCanceledDefaultHandling(const Event& event) { 16 return event.phase() == EP_POSTTARGET && event.result() != ER_UNHANDLED; 17 } 18 19 int RegisterCustomEventType() { 20 return ++g_custom_event_types; 21 } 22 23 base::TimeDelta EventTimeForNow() { 24 return base::TimeDelta::FromInternalValue( 25 base::TimeTicks::Now().ToInternalValue()); 26 } 27 28 } // namespace ui 29