| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ | 5 #ifndef CONTENT_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ |
| 6 #define CONTENT_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ | 6 #define CONTENT_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 scoped_ptr<cc::OutputSurface> CreateOutputSurface(); | 26 scoped_ptr<cc::OutputSurface> CreateOutputSurface(); |
| 27 | 27 |
| 28 static RenderWidgetMusConnection* Get(int routing_id); | 28 static RenderWidgetMusConnection* Get(int routing_id); |
| 29 | 29 |
| 30 // Get the connection from a routing_id, if the connection doesn't exist, | 30 // Get the connection from a routing_id, if the connection doesn't exist, |
| 31 // a new connection will be created. | 31 // a new connection will be created. |
| 32 static RenderWidgetMusConnection* GetOrCreate(int routing_id); | 32 static RenderWidgetMusConnection* GetOrCreate(int routing_id); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 friend class CompositorMusConnection; | 35 friend class CompositorMusConnection; |
| 36 friend class CompositorMusConnectionTest; |
| 36 | 37 |
| 37 explicit RenderWidgetMusConnection(int routing_id); | 38 explicit RenderWidgetMusConnection(int routing_id); |
| 38 ~RenderWidgetMusConnection() override; | 39 ~RenderWidgetMusConnection() override; |
| 39 | 40 |
| 40 // RenderWidgetInputHandlerDelegate implementation: | 41 // RenderWidgetInputHandlerDelegate implementation: |
| 41 void FocusChangeComplete() override; | 42 void FocusChangeComplete() override; |
| 42 bool HasTouchEventHandlersAt(const gfx::Point& point) const override; | 43 bool HasTouchEventHandlersAt(const gfx::Point& point) const override; |
| 43 void ObserveWheelEventAndResult(const blink::WebMouseWheelEvent& wheel_event, | 44 void ObserveWheelEventAndResult(const blink::WebMouseWheelEvent& wheel_event, |
| 44 const gfx::Vector2dF& wheel_unused_delta, | 45 const gfx::Vector2dF& wheel_unused_delta, |
| 45 bool event_processed) override; | 46 bool event_processed) override; |
| 46 void OnDidHandleKeyEvent() override; | 47 void OnDidHandleKeyEvent() override; |
| 47 void OnDidOverscroll(const DidOverscrollParams& params) override; | 48 void OnDidOverscroll(const DidOverscrollParams& params) override; |
| 48 void OnInputEventAck(scoped_ptr<InputEventAck> input_event_ack) override; | 49 void OnInputEventAck(scoped_ptr<InputEventAck> input_event_ack) override; |
| 49 void NonBlockingInputEventHandled( | 50 void NonBlockingInputEventHandled( |
| 50 blink::WebInputEvent::Type handled_type) override; | 51 blink::WebInputEvent::Type handled_type) override; |
| 51 void SetInputHandler(RenderWidgetInputHandler* input_handler) override; | 52 void SetInputHandler(RenderWidgetInputHandler* input_handler) override; |
| 52 void UpdateTextInputState(ShowIme show_ime, | 53 void UpdateTextInputState(ShowIme show_ime, |
| 53 ChangeSource change_source) override; | 54 ChangeSource change_source) override; |
| 54 bool WillHandleGestureEvent(const blink::WebGestureEvent& event) override; | 55 bool WillHandleGestureEvent(const blink::WebGestureEvent& event) override; |
| 55 bool WillHandleMouseEvent(const blink::WebMouseEvent& event) override; | 56 bool WillHandleMouseEvent(const blink::WebMouseEvent& event) override; |
| 56 | 57 |
| 57 void OnConnectionLost(); | 58 void OnConnectionLost(); |
| 58 void OnWindowInputEvent(scoped_ptr<blink::WebInputEvent> input_event, | 59 void OnWindowInputEvent(scoped_ptr<blink::WebInputEvent> input_event, |
| 59 const base::Closure& ack); | 60 const base::Callback<void(bool)>& ack); |
| 60 | 61 |
| 61 const int routing_id_; | 62 const int routing_id_; |
| 62 RenderWidgetInputHandler* input_handler_; | 63 RenderWidgetInputHandler* input_handler_; |
| 63 scoped_ptr<mus::WindowSurfaceBinding> window_surface_binding_; | 64 scoped_ptr<mus::WindowSurfaceBinding> window_surface_binding_; |
| 64 scoped_refptr<CompositorMusConnection> compositor_mus_connection_; | 65 scoped_refptr<CompositorMusConnection> compositor_mus_connection_; |
| 65 | 66 |
| 66 base::Closure pending_ack_; | 67 base::Callback<void(bool)> pending_ack_; |
| 67 | 68 |
| 68 // Used to verify single threaded access. | 69 // Used to verify single threaded access. |
| 69 base::ThreadChecker thread_checker_; | 70 base::ThreadChecker thread_checker_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(RenderWidgetMusConnection); | 72 DISALLOW_COPY_AND_ASSIGN(RenderWidgetMusConnection); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace content | 75 } // namespace content |
| 75 | 76 |
| 76 #endif // CONTENT_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ | 77 #endif // CONTENT_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ |
| OLD | NEW |