blob: fe0718e370fbdf0a582bd29900e75f8b8b7b2693 [file] [log] [blame]
// Copyright 2017 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.
#ifndef CHROME_BROWSER_VR_PLATFORM_CONTROLLER_H_
#define CHROME_BROWSER_VR_PLATFORM_CONTROLLER_H_
namespace vr {
// This class is not platform-specific. It will be backed by platform-specific
// controller code, but its interface must be platform-agnostic. For example,
// the enumeration of buttons may map to buttons with different names on a
// different platform's controller, but the functionality must exist. I.e., the
// concept of "the button you press to exit fullscreen / presentation" is
// universal.
class PlatformController {
public:
enum ButtonType {
kButtonHome,
kButtonMenu,
kButtonSelect,
};
enum SwipeDirection {
kSwipeDirectionNone,
kSwipeDirectionLeft,
kSwipeDirectionRight,
kSwipeDirectionUp,
kSwipeDirectionDown,
};
virtual ~PlatformController() {}
virtual bool IsButtonDown(ButtonType type) const = 0;
virtual base::TimeTicks GetLastOrientationTimestamp() const = 0;
virtual base::TimeTicks GetLastTouchTimestamp() const = 0;
virtual base::TimeTicks GetLastButtonTimestamp() const = 0;
};
} // namespace vr
#endif // CHROME_BROWSER_VR_PLATFORM_CONTROLLER_H_