IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / browser / renderer_host / input / mock_input_ack_handler.h
blob88ca9e186fcbedfd6f6a7fcac6a58155b090eb6e
1 // Copyright 2013 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.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ACK_HANDLER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ACK_HANDLER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "content/browser/renderer_host/input/input_ack_handler.h"
11 namespace content {
13 class InputRouter;
15 class MockInputAckHandler : public InputAckHandler {
16 public:
17 MockInputAckHandler();
18 virtual ~MockInputAckHandler();
20 // InputAckHandler
21 virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event,
22 InputEventAckState ack_result) OVERRIDE;
23 virtual void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event,
24 InputEventAckState ack_result) OVERRIDE;
25 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event,
26 InputEventAckState ack_result) OVERRIDE;
27 virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event,
28 InputEventAckState ack_result) OVERRIDE;
29 virtual void OnUnexpectedEventAck(UnexpectedEventAckType type) OVERRIDE;
31 size_t GetAndResetAckCount();
33 void set_input_router(InputRouter* input_router) {
34 input_router_ = input_router;
37 void set_followup_touch_event(scoped_ptr<GestureEventWithLatencyInfo> event) {
38 gesture_followup_event_ = event.Pass();
41 void set_followup_touch_event(scoped_ptr<TouchEventWithLatencyInfo> event) {
42 touch_followup_event_ = event.Pass();
45 bool unexpected_event_ack_called() const {
46 return unexpected_event_ack_called_;
48 InputEventAckState ack_state() const { return ack_state_; }
50 const NativeWebKeyboardEvent& acked_keyboard_event() const {
51 return acked_key_event_;
53 const blink::WebMouseWheelEvent& acked_wheel_event() const {
54 return acked_wheel_event_;
56 const TouchEventWithLatencyInfo& acked_touch_event() const {
57 return acked_touch_event_;
59 const blink::WebGestureEvent& acked_gesture_event() const {
60 return acked_gesture_event_;
63 private:
64 void RecordAckCalled(InputEventAckState ack_result);
66 InputRouter* input_router_;
68 size_t ack_count_;
69 bool unexpected_event_ack_called_;
70 InputEventAckState ack_state_;
71 NativeWebKeyboardEvent acked_key_event_;
72 blink::WebMouseWheelEvent acked_wheel_event_;
73 TouchEventWithLatencyInfo acked_touch_event_;
74 blink::WebGestureEvent acked_gesture_event_;
76 scoped_ptr<GestureEventWithLatencyInfo> gesture_followup_event_;
77 scoped_ptr<TouchEventWithLatencyInfo> touch_followup_event_;
80 } // namespace content
82 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ACK_HANDLER_H_