blob: aafa4639b7ceff753509153ca31e9768b8730e06 [file] [log] [blame]
// 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.
#ifndef GamepadEvent_h
#define GamepadEvent_h
#include "modules/EventModules.h"
#include "modules/gamepad/Gamepad.h"
#include "modules/gamepad/GamepadEventInit.h"
namespace blink {
class GamepadEvent final : public Event {
DEFINE_WRAPPERTYPEINFO();
public:
static GamepadEvent* Create(const AtomicString& type,
Bubbles bubbles,
Cancelable cancelable,
Gamepad* gamepad) {
return new GamepadEvent(type, bubbles, cancelable, gamepad);
}
static GamepadEvent* Create(const AtomicString& type,
const GamepadEventInit& initializer) {
return new GamepadEvent(type, initializer);
}
~GamepadEvent() override;
Gamepad* getGamepad() const { return gamepad_.Get(); }
const AtomicString& InterfaceName() const override;
void Trace(blink::Visitor*) override;
private:
GamepadEvent(const AtomicString& type, Bubbles, Cancelable, Gamepad*);
GamepadEvent(const AtomicString&, const GamepadEventInit&);
Member<Gamepad> gamepad_;
};
} // namespace blink
#endif // GamepadEvent_h