| OLD | NEW | 
|    1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2012 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_RENDER_WIDGET_HOST_IMPL_H_ |    5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 
|    6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |    6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 
|    7  |    7  | 
|    8 #include <deque> |    8 #include <deque> | 
|    9 #include <list> |    9 #include <list> | 
|   10 #include <map> |   10 #include <map> | 
|   11 #include <queue> |   11 #include <queue> | 
|   12 #include <string> |   12 #include <string> | 
|   13 #include <utility> |   13 #include <utility> | 
|   14 #include <vector> |   14 #include <vector> | 
|   15  |   15  | 
|   16 #include "base/callback.h" |   16 #include "base/callback.h" | 
|   17 #include "base/gtest_prod_util.h" |   17 #include "base/gtest_prod_util.h" | 
|   18 #include "base/memory/scoped_ptr.h" |   18 #include "base/memory/scoped_ptr.h" | 
|   19 #include "base/memory/weak_ptr.h" |   19 #include "base/memory/weak_ptr.h" | 
|   20 #include "base/observer_list.h" |   20 #include "base/observer_list.h" | 
|   21 #include "base/process/kill.h" |   21 #include "base/process/kill.h" | 
|   22 #include "base/strings/string16.h" |   22 #include "base/strings/string16.h" | 
|   23 #include "base/time/time.h" |   23 #include "base/time/time.h" | 
|   24 #include "base/timer/timer.h" |   24 #include "base/timer/timer.h" | 
|   25 #include "build/build_config.h" |   25 #include "build/build_config.h" | 
 |   26 #include "content/browser/renderer_host/input/input_ack_handler.h" | 
|   26 #include "content/browser/renderer_host/input/input_router_client.h" |   27 #include "content/browser/renderer_host/input/input_router_client.h" | 
|   27 #include "content/browser/renderer_host/synthetic_gesture_controller.h" |   28 #include "content/browser/renderer_host/synthetic_gesture_controller.h" | 
|   28 #include "content/common/browser_rendering_stats.h" |   29 #include "content/common/browser_rendering_stats.h" | 
|   29 #include "content/common/view_message_enums.h" |   30 #include "content/common/view_message_enums.h" | 
|   30 #include "content/port/browser/event_with_latency_info.h" |   31 #include "content/port/browser/event_with_latency_info.h" | 
|   31 #include "content/port/common/input_event_ack_state.h" |   32 #include "content/port/common/input_event_ack_state.h" | 
|   32 #include "content/public/browser/render_widget_host.h" |   33 #include "content/public/browser/render_widget_host.h" | 
|   33 #include "content/public/common/page_zoom.h" |   34 #include "content/public/common/page_zoom.h" | 
|   34 #include "ipc/ipc_listener.h" |   35 #include "ipc/ipc_listener.h" | 
|   35 #include "ui/base/ime/text_input_mode.h" |   36 #include "ui/base/ime/text_input_mode.h" | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   81 class OverscrollController; |   82 class OverscrollController; | 
|   82 class RenderWidgetHostDelegate; |   83 class RenderWidgetHostDelegate; | 
|   83 class RenderWidgetHostViewPort; |   84 class RenderWidgetHostViewPort; | 
|   84 class SyntheticGestureController; |   85 class SyntheticGestureController; | 
|   85 struct EditCommand; |   86 struct EditCommand; | 
|   86  |   87  | 
|   87 // This implements the RenderWidgetHost interface that is exposed to |   88 // This implements the RenderWidgetHost interface that is exposed to | 
|   88 // embedders of content, and adds things only visible to content. |   89 // embedders of content, and adds things only visible to content. | 
|   89 class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |   90 class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, | 
|   90                                             public InputRouterClient, |   91                                             public InputRouterClient, | 
 |   92                                             public InputAckHandler, | 
|   91                                             public IPC::Listener { |   93                                             public IPC::Listener { | 
|   92  public: |   94  public: | 
|   93   // routing_id can be MSG_ROUTING_NONE, in which case the next available |   95   // routing_id can be MSG_ROUTING_NONE, in which case the next available | 
|   94   // routing id is taken from the RenderProcessHost. |   96   // routing id is taken from the RenderProcessHost. | 
|   95   // If this object outlives |delegate|, DetachDelegate() must be called when |   97   // If this object outlives |delegate|, DetachDelegate() must be called when | 
|   96   // |delegate| goes away. |   98   // |delegate| goes away. | 
|   97   RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, |   99   RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, | 
|   98                        RenderProcessHost* process, |  100                        RenderProcessHost* process, | 
|   99                        int routing_id, |  101                        int routing_id, | 
|  100                        bool hidden); |  102                        bool hidden); | 
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  732   virtual bool OnSendTouchEvent( |  734   virtual bool OnSendTouchEvent( | 
|  733       const TouchEventWithLatencyInfo& touch_event) OVERRIDE; |  735       const TouchEventWithLatencyInfo& touch_event) OVERRIDE; | 
|  734   virtual bool OnSendGestureEvent( |  736   virtual bool OnSendGestureEvent( | 
|  735       const GestureEventWithLatencyInfo& gesture_event) OVERRIDE; |  737       const GestureEventWithLatencyInfo& gesture_event) OVERRIDE; | 
|  736   virtual bool OnSendMouseEventImmediately( |  738   virtual bool OnSendMouseEventImmediately( | 
|  737       const MouseEventWithLatencyInfo& mouse_event) OVERRIDE; |  739       const MouseEventWithLatencyInfo& mouse_event) OVERRIDE; | 
|  738   virtual bool OnSendTouchEventImmediately( |  740   virtual bool OnSendTouchEventImmediately( | 
|  739       const TouchEventWithLatencyInfo& touch_event) OVERRIDE; |  741       const TouchEventWithLatencyInfo& touch_event) OVERRIDE; | 
|  740   virtual bool OnSendGestureEventImmediately( |  742   virtual bool OnSendGestureEventImmediately( | 
|  741       const GestureEventWithLatencyInfo& gesture_event) OVERRIDE; |  743       const GestureEventWithLatencyInfo& gesture_event) OVERRIDE; | 
 |  744   virtual void SetNeedsFlush() OVERRIDE; | 
 |  745   virtual void DidFlush() OVERRIDE; | 
 |  746  | 
 |  747   // InputAckHandler | 
|  742   virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, |  748   virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, | 
|  743                                   InputEventAckState ack_result) OVERRIDE; |  749                                   InputEventAckState ack_result) OVERRIDE; | 
|  744   virtual void OnWheelEventAck(const WebKit::WebMouseWheelEvent& event, |  750   virtual void OnWheelEventAck(const WebKit::WebMouseWheelEvent& event, | 
|  745                                InputEventAckState ack_result) OVERRIDE; |  751                                InputEventAckState ack_result) OVERRIDE; | 
|  746   virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, |  752   virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 
|  747                                InputEventAckState ack_result) OVERRIDE; |  753                                InputEventAckState ack_result) OVERRIDE; | 
|  748   virtual void OnGestureEventAck(const WebKit::WebGestureEvent& event, |  754   virtual void OnGestureEventAck(const WebKit::WebGestureEvent& event, | 
|  749                                  InputEventAckState ack_result) OVERRIDE; |  755                                  InputEventAckState ack_result) OVERRIDE; | 
|  750   virtual void OnUnexpectedEventAck(bool bad_message) OVERRIDE; |  756   virtual void OnUnexpectedEventAck(UnexpectedEventAckType type) OVERRIDE; | 
|  751  |  757  | 
|  752   void SimulateTouchGestureWithMouse(const WebKit::WebMouseEvent& mouse_event); |  758   void SimulateTouchGestureWithMouse(const WebKit::WebMouseEvent& mouse_event); | 
|  753  |  759  | 
|  754   // Called when there is a new auto resize (using a post to avoid a stack |  760   // Called when there is a new auto resize (using a post to avoid a stack | 
|  755   // which may get in recursive loops). |  761   // which may get in recursive loops). | 
|  756   void DelayedAutoResized(); |  762   void DelayedAutoResized(); | 
|  757  |  763  | 
|  758  |  | 
|  759   // Our delegate, which wants to know mainly about keyboard events. |  764   // Our delegate, which wants to know mainly about keyboard events. | 
|  760   // It will remain non-NULL until DetachDelegate() is called. |  765   // It will remain non-NULL until DetachDelegate() is called. | 
|  761   RenderWidgetHostDelegate* delegate_; |  766   RenderWidgetHostDelegate* delegate_; | 
|  762  |  767  | 
|  763   // Created during construction but initialized during Init*(). Therefore, it |  768   // Created during construction but initialized during Init*(). Therefore, it | 
|  764   // is guaranteed never to be NULL, but its channel may be NULL if the |  769   // is guaranteed never to be NULL, but its channel may be NULL if the | 
|  765   // renderer crashed, so you must always check that. |  770   // renderer crashed, so you must always check that. | 
|  766   RenderProcessHost* process_; |  771   RenderProcessHost* process_; | 
|  767  |  772  | 
|  768   // The ID of the corresponding object in the Renderer Instance. |  773   // The ID of the corresponding object in the Renderer Instance. | 
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  929   int64 last_input_number_; |  934   int64 last_input_number_; | 
|  930  |  935  | 
|  931   BrowserRenderingStats rendering_stats_; |  936   BrowserRenderingStats rendering_stats_; | 
|  932  |  937  | 
|  933   DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |  938   DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 
|  934 }; |  939 }; | 
|  935  |  940  | 
|  936 }  // namespace content |  941 }  // namespace content | 
|  937  |  942  | 
|  938 #endif  // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |  943 #endif  // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 
| OLD | NEW |