Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc
diff --git a/ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc b/ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc
deleted file mode 100644
index 6aad16196b2d0119b0555418e6985b4047b930fa..0000000000000000000000000000000000000000
--- a/ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2014 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/events/ozone/evdev/libgestures_glue/gesture_timer_provider.h"
-
-#include <gestures/gestures.h>
-
-#include "base/timer/timer.h"
-
-// libgestures requires that this be in the top level namespace.
-class GesturesTimer {
- public:
- GesturesTimer() : callback_(NULL), callback_data_(NULL) {}
- ~GesturesTimer() {}
-
- void Set(stime_t delay, GesturesTimerCallback callback, void* callback_data) {
- callback_ = callback;
- callback_data_ = callback_data;
- timer_.Start(FROM_HERE,
- base::TimeDelta::FromMicroseconds(
- delay * base::Time::kMicrosecondsPerSecond),
- this,
- &GesturesTimer::OnTimerExpired);
- }
-
- void Cancel() { timer_.Stop(); }
-
- private:
- void OnTimerExpired() {
- struct timespec ts;
- DCHECK(!clock_gettime(CLOCK_MONOTONIC, &ts));
- stime_t next_delay = callback_(StimeFromTimespec(&ts), callback_data_);
- if (next_delay >= 0) {
- timer_.Start(FROM_HERE,
- base::TimeDelta::FromMicroseconds(
- next_delay * base::Time::kMicrosecondsPerSecond),
- this,
- &GesturesTimer::OnTimerExpired);
- }
- }
-
- GesturesTimerCallback callback_;
- void* callback_data_;
- base::OneShotTimer<GesturesTimer> timer_;
-};
-
-namespace ui {
-
-namespace {
-
-GesturesTimer* GesturesTimerCreate(void* data) { return new GesturesTimer; }
-
-void GesturesTimerSet(void* data,
- GesturesTimer* timer,
- stime_t delay,
- GesturesTimerCallback callback,
- void* callback_data) {
- timer->Set(delay, callback, callback_data);
-}
-
-void GesturesTimerCancel(void* data, GesturesTimer* timer) { timer->Cancel(); }
-
-void GesturesTimerFree(void* data, GesturesTimer* timer) { delete timer; }
-
-} // namespace
-
-const GesturesTimerProvider kGestureTimerProvider = {
- GesturesTimerCreate, GesturesTimerSet, GesturesTimerCancel,
- GesturesTimerFree};
-
-} // namespace ui
« no previous file with comments | « ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.h ('k') | ui/events/ozone/evdev/touch_event_converter_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698