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

Side by Side Diff: content/browser/renderer_host/input/input_router.h

Issue 1408213002: Add hooks for flushing input from BeginFrame dispatch on Aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build for real Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "content/browser/renderer_host/event_with_latency_info.h" 9 #include "content/browser/renderer_host/event_with_latency_info.h"
10 #include "content/common/input/input_event_ack_state.h" 10 #include "content/common/input/input_event_ack_state.h"
(...skipping 11 matching lines...) Expand all
22 // received, it is free to customize when those events are dispatched. 22 // received, it is free to customize when those events are dispatched.
23 class InputRouter : public IPC::Listener { 23 class InputRouter : public IPC::Listener {
24 public: 24 public:
25 ~InputRouter() override {} 25 ~InputRouter() override {}
26 26
27 // Send and take ownership of the the given InputMsg_*. This should be used 27 // Send and take ownership of the the given InputMsg_*. This should be used
28 // only for event types not associated with a WebInputEvent. Returns true on 28 // only for event types not associated with a WebInputEvent. Returns true on
29 // success and false otherwise. 29 // success and false otherwise.
30 virtual bool SendInput(scoped_ptr<IPC::Message> message) = 0; 30 virtual bool SendInput(scoped_ptr<IPC::Message> message) = 0;
31 31
32 // Called in response to a |SetNeedsFlushInput()| call made via the client.
33 // This is conditionally used for events that are best sent at a particular
34 // time, e.g., with scroll/wheel updates just before BeginFrame dispatch.
35 virtual void FlushInput(base::TimeTicks flush_time) = 0;
36
32 // WebInputEvents 37 // WebInputEvents
33 virtual void SendMouseEvent( 38 virtual void SendMouseEvent(
34 const MouseEventWithLatencyInfo& mouse_event) = 0; 39 const MouseEventWithLatencyInfo& mouse_event) = 0;
35 virtual void SendWheelEvent( 40 virtual void SendWheelEvent(
36 const MouseWheelEventWithLatencyInfo& wheel_event) = 0; 41 const MouseWheelEventWithLatencyInfo& wheel_event) = 0;
37 virtual void SendKeyboardEvent( 42 virtual void SendKeyboardEvent(
38 const NativeWebKeyboardEventWithLatencyInfo& key_event) = 0; 43 const NativeWebKeyboardEventWithLatencyInfo& key_event) = 0;
39 virtual void SendGestureEvent( 44 virtual void SendGestureEvent(
40 const GestureEventWithLatencyInfo& gesture_event) = 0; 45 const GestureEventWithLatencyInfo& gesture_event) = 0;
41 virtual void SendTouchEvent( 46 virtual void SendTouchEvent(
42 const TouchEventWithLatencyInfo& touch_event) = 0; 47 const TouchEventWithLatencyInfo& touch_event) = 0;
43 48
44 // Returns the oldest queued or in-flight keyboard event sent to the router. 49 // Returns the oldest queued or in-flight keyboard event sent to the router.
45 virtual const NativeWebKeyboardEvent* GetLastKeyboardEvent() const = 0; 50 virtual const NativeWebKeyboardEvent* GetLastKeyboardEvent() const = 0;
46 51
47 // Notify the router about whether the current page is mobile-optimized (i.e., 52 // Notify the router about whether the current page is mobile-optimized (i.e.,
48 // the site has a mobile-friendly viewport). 53 // the site has a mobile-friendly viewport).
49 virtual void NotifySiteIsMobileOptimized(bool is_mobile_optimized) = 0; 54 virtual void NotifySiteIsMobileOptimized(bool is_mobile_optimized) = 0;
50 55
51 // Request a notification from the input router when all events have been
52 // fully dispatched and there are no longer any pending events.
53 // Note: This may trigger a synchronous notification if the router is empty.
54 virtual void RequestNotificationWhenFlushed() = 0;
55
56 // Whether there are any events pending dispatch to or ack from the renderer. 56 // Whether there are any events pending dispatch to or ack from the renderer.
57 virtual bool HasPendingEvents() const = 0; 57 virtual bool HasPendingEvents() const = 0;
58 }; 58 };
59 59
60 } // namespace content 60 } // namespace content
61 61
62 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_H_ 62 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698