| 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 <map> | 9 #include <map> |
| 10 #include <queue> | 10 #include <queue> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/process_util.h" | 18 #include "base/process_util.h" |
| 19 #include "base/string16.h" | 19 #include "base/string16.h" |
| 20 #include "base/time.h" | 20 #include "base/time.h" |
| 21 #include "base/timer.h" | 21 #include "base/timer.h" |
| 22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "content/common/view_message_enums.h" | 23 #include "content/common/view_message_enums.h" |
| 24 #include "content/public/browser/render_widget_host.h" | 24 #include "content/public/browser/render_widget_host.h" |
| 25 #include "content/public/common/page_zoom.h" | 25 #include "content/public/common/page_zoom.h" |
| 26 #include "ui/base/ime/text_input_type.h" | 26 #include "ui/base/ime/text_input_type.h" |
| 27 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
| 28 | 28 |
| 29 class MockRenderWidgetHost; | |
| 30 class WebCursor; | 29 class WebCursor; |
| 31 struct ViewHostMsg_UpdateRect_Params; | 30 struct ViewHostMsg_UpdateRect_Params; |
| 32 struct ViewHostMsg_TextInputState_Params; | 31 struct ViewHostMsg_TextInputState_Params; |
| 33 struct ViewHostMsg_BeginSmoothScroll_Params; | 32 struct ViewHostMsg_BeginSmoothScroll_Params; |
| 34 | 33 |
| 35 namespace base { | 34 namespace base { |
| 36 class TimeTicks; | 35 class TimeTicks; |
| 37 } | 36 } |
| 38 | 37 |
| 39 namespace ui { | 38 namespace ui { |
| 40 class KeyEvent; | 39 class KeyEvent; |
| 41 class Range; | 40 class Range; |
| 42 } | 41 } |
| 43 | 42 |
| 44 namespace WebKit { | 43 namespace WebKit { |
| 45 class WebInputEvent; | 44 class WebInputEvent; |
| 46 class WebMouseEvent; | 45 class WebMouseEvent; |
| 47 struct WebCompositionUnderline; | 46 struct WebCompositionUnderline; |
| 48 struct WebScreenInfo; | 47 struct WebScreenInfo; |
| 49 } | 48 } |
| 50 | 49 |
| 51 #if defined(OS_ANDROID) | 50 #if defined(OS_ANDROID) |
| 52 namespace WebKit { | 51 namespace WebKit { |
| 53 class WebLayer; | 52 class WebLayer; |
| 54 } | 53 } |
| 55 #endif | 54 #endif |
| 56 | 55 |
| 57 namespace content { | 56 namespace content { |
| 58 class BackingStore; | 57 class BackingStore; |
| 59 struct EditCommand; | |
| 60 class GestureEventFilter; | 58 class GestureEventFilter; |
| 59 class MockRenderWidgetHost; |
| 61 class RenderWidgetHostDelegate; | 60 class RenderWidgetHostDelegate; |
| 62 class RenderWidgetHostViewPort; | 61 class RenderWidgetHostViewPort; |
| 63 class SmoothScrollGesture; | 62 class SmoothScrollGesture; |
| 64 class TouchEventQueue; | 63 class TouchEventQueue; |
| 64 struct EditCommand; |
| 65 | 65 |
| 66 // This implements the RenderWidgetHost interface that is exposed to | 66 // This implements the RenderWidgetHost interface that is exposed to |
| 67 // embedders of content, and adds things only visible to content. | 67 // embedders of content, and adds things only visible to content. |
| 68 class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, | 68 class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
| 69 public IPC::Listener { | 69 public IPC::Listener { |
| 70 public: | 70 public: |
| 71 // routing_id can be MSG_ROUTING_NONE, in which case the next available | 71 // routing_id can be MSG_ROUTING_NONE, in which case the next available |
| 72 // routing id is taken from the RenderProcessHost. | 72 // routing id is taken from the RenderProcessHost. |
| 73 // If this object outlives |delegate|, DetachDelegate() must be called when | 73 // If this object outlives |delegate|, DetachDelegate() must be called when |
| 74 // |delegate| goes away. | 74 // |delegate| goes away. |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 // tab only when we lose our renderer and not if a paint occurs during | 513 // tab only when we lose our renderer and not if a paint occurs during |
| 514 // initialization. | 514 // initialization. |
| 515 bool renderer_initialized_; | 515 bool renderer_initialized_; |
| 516 | 516 |
| 517 // This value indicates how long to wait before we consider a renderer hung. | 517 // This value indicates how long to wait before we consider a renderer hung. |
| 518 int hung_renderer_delay_ms_; | 518 int hung_renderer_delay_ms_; |
| 519 | 519 |
| 520 std::queue<WebKit::WebInputEvent::Type> in_process_event_types_; | 520 std::queue<WebKit::WebInputEvent::Type> in_process_event_types_; |
| 521 | 521 |
| 522 private: | 522 private: |
| 523 friend class ::MockRenderWidgetHost; | 523 friend class MockRenderWidgetHost; |
| 524 | 524 |
| 525 // Tell this object to destroy itself. | 525 // Tell this object to destroy itself. |
| 526 void Destroy(); | 526 void Destroy(); |
| 527 | 527 |
| 528 // Checks whether the renderer is hung and calls NotifyRendererUnresponsive | 528 // Checks whether the renderer is hung and calls NotifyRendererUnresponsive |
| 529 // if it is. | 529 // if it is. |
| 530 void CheckRendererIsUnresponsive(); | 530 void CheckRendererIsUnresponsive(); |
| 531 | 531 |
| 532 // Called if we know the renderer is responsive. When we currently think the | 532 // Called if we know the renderer is responsive. When we currently think the |
| 533 // renderer is unresponsive, this will clear that state and call | 533 // renderer is unresponsive, this will clear that state and call |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 | 839 |
| 840 scoped_ptr<TouchEventQueue> touch_event_queue_; | 840 scoped_ptr<TouchEventQueue> touch_event_queue_; |
| 841 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 841 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
| 842 | 842 |
| 843 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 843 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 844 }; | 844 }; |
| 845 | 845 |
| 846 } // namespace content | 846 } // namespace content |
| 847 | 847 |
| 848 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 848 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |