summaryrefslogtreecommitdiff
path: root/chromium/ui/base/events/event_utils.cc
blob: ac09854bbfb9319dc46ec2a018b1444212677993 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/base/events/event_utils.h"

#include "ui/base/events/event.h"

namespace ui {

namespace {
int g_custom_event_types = ET_LAST;
}  // namespace

bool EventCanceledDefaultHandling(const Event& event) {
  return event.phase() == EP_POSTTARGET && event.result() != ER_UNHANDLED;
}

int RegisterCustomEventType() {
  return ++g_custom_event_types;
}

base::TimeDelta EventTimeForNow() {
  return base::TimeDelta::FromInternalValue(
      base::TimeTicks::Now().ToInternalValue());
}

}  // namespace ui