Battery Status API: add UMA logging for Linux.
[chromium-blink-merge.git] / content / browser / renderer_host / input / mock_input_router_client.h
blobf0b31676ffda25e7e7afd818816352d0ea2d8750
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_ROUTER_CLIENT_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "content/browser/renderer_host/input/input_router_client.h"
10 #include "content/common/input/did_overscroll_params.h"
12 namespace content {
14 class InputEvent;
15 class InputRouter;
17 class MockInputRouterClient : public InputRouterClient {
18 public:
19 MockInputRouterClient();
20 virtual ~MockInputRouterClient();
22 // InputRouterClient
23 virtual InputEventAckState FilterInputEvent(
24 const blink::WebInputEvent& input_event,
25 const ui::LatencyInfo& latency_info) OVERRIDE;
26 virtual void IncrementInFlightEventCount() OVERRIDE;
27 virtual void DecrementInFlightEventCount() OVERRIDE;
28 virtual void OnHasTouchEventHandlers(bool has_handlers) OVERRIDE;
29 virtual void SetNeedsFlush() OVERRIDE;
30 virtual void DidFlush() OVERRIDE;
31 virtual void DidOverscroll(const DidOverscrollParams& params) OVERRIDE;
33 bool GetAndResetFilterEventCalled();
34 size_t GetAndResetDidFlushCount();
35 DidOverscrollParams GetAndResetOverscroll();
37 void set_input_router(InputRouter* input_router) {
38 input_router_ = input_router;
41 bool has_touch_handler() const { return has_touch_handler_; }
42 void set_filter_state(InputEventAckState filter_state) {
43 filter_state_ = filter_state;
45 int in_flight_event_count() const {
46 return in_flight_event_count_;
48 void set_allow_send_event(bool allow) {
49 filter_state_ = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
52 private:
53 InputRouter* input_router_;
54 int in_flight_event_count_;
55 bool has_touch_handler_;
57 InputEventAckState filter_state_;
59 bool filter_input_event_called_;
60 scoped_ptr<InputEvent> last_filter_event_;
62 size_t did_flush_called_count_;
63 bool set_needs_flush_called_;
65 DidOverscrollParams overscroll_;
68 } // namespace content
70 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_