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_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 struct ViewMsg_Resize_Params; | 47 struct ViewMsg_Resize_Params; |
48 class ViewHostMsg_UpdateRect; | 48 class ViewHostMsg_UpdateRect; |
49 | 49 |
50 namespace IPC { | 50 namespace IPC { |
51 class SyncMessage; | 51 class SyncMessage; |
52 class SyncMessageFilter; | 52 class SyncMessageFilter; |
53 } | 53 } |
54 | 54 |
55 namespace blink { | 55 namespace blink { |
56 struct WebDeviceEmulationParams; | 56 struct WebDeviceEmulationParams; |
| 57 class WebFrameWidget; |
57 class WebGestureEvent; | 58 class WebGestureEvent; |
58 class WebKeyboardEvent; | 59 class WebKeyboardEvent; |
| 60 class WebLocalFrame; |
59 class WebMouseEvent; | 61 class WebMouseEvent; |
60 class WebTouchEvent; | 62 class WebTouchEvent; |
| 63 class WebView; |
61 } | 64 } |
62 | 65 |
63 namespace cc { | 66 namespace cc { |
64 struct InputHandlerScrollResult; | 67 struct InputHandlerScrollResult; |
65 class OutputSurface; | 68 class OutputSurface; |
66 class SwapPromise; | 69 class SwapPromise; |
67 } | 70 } |
68 | 71 |
69 namespace gfx { | 72 namespace gfx { |
70 class Range; | 73 class Range; |
(...skipping 20 matching lines...) Expand all Loading... |
91 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient), | 94 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient), |
92 public base::RefCounted<RenderWidget> { | 95 public base::RefCounted<RenderWidget> { |
93 public: | 96 public: |
94 // Creates a new RenderWidget. The opener_id is the routing ID of the | 97 // Creates a new RenderWidget. The opener_id is the routing ID of the |
95 // RenderView that this widget lives inside. | 98 // RenderView that this widget lives inside. |
96 static RenderWidget* Create(int32 opener_id, | 99 static RenderWidget* Create(int32 opener_id, |
97 CompositorDependencies* compositor_deps, | 100 CompositorDependencies* compositor_deps, |
98 blink::WebPopupType popup_type, | 101 blink::WebPopupType popup_type, |
99 const blink::WebScreenInfo& screen_info); | 102 const blink::WebScreenInfo& screen_info); |
100 | 103 |
| 104 // Creates a new RenderWidget that will be attached to a RenderFrame. |
| 105 static RenderWidget* CreateForFrame(int routing_id, |
| 106 int surface_id, |
| 107 bool hidden, |
| 108 const blink::WebScreenInfo& screen_info, |
| 109 CompositorDependencies* compositor_deps, |
| 110 blink::WebLocalFrame* frame); |
| 111 |
| 112 static blink::WebWidget* CreateWebFrameWidget(RenderWidget* render_widget, |
| 113 blink::WebLocalFrame* frame); |
| 114 |
101 // Creates a WebWidget based on the popup type. | 115 // Creates a WebWidget based on the popup type. |
102 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); | 116 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); |
103 | 117 |
104 int32 routing_id() const { return routing_id_; } | 118 int32 routing_id() const { return routing_id_; } |
105 int32 surface_id() const { return surface_id_; } | 119 int32 surface_id() const { return surface_id_; } |
106 CompositorDependencies* compositor_deps() const { return compositor_deps_; } | 120 CompositorDependencies* compositor_deps() const { return compositor_deps_; } |
107 blink::WebWidget* webwidget() const { return webwidget_; } | 121 blink::WebWidget* webwidget() const { return webwidget_; } |
108 gfx::Size size() const { return size_; } | 122 gfx::Size size() const { return size_; } |
109 bool has_focus() const { return has_focus_; } | 123 bool has_focus() const { return has_focus_; } |
110 bool is_fullscreen() const { return is_fullscreen_; } | 124 bool is_fullscreen() const { return is_fullscreen_; } |
111 bool is_hidden() const { return is_hidden_; } | 125 bool is_hidden() const { return is_hidden_; } |
112 bool handling_input_event() const { return handling_input_event_; } | 126 bool handling_input_event() const { return handling_input_event_; } |
113 // Temporary for debugging purposes... | 127 // Temporary for debugging purposes... |
114 bool closing() const { return closing_; } | 128 bool closing() const { return closing_; } |
115 bool is_swapped_out() { return is_swapped_out_; } | 129 bool is_swapped_out() { return is_swapped_out_; } |
116 ui::MenuSourceType context_menu_source_type() { | 130 ui::MenuSourceType context_menu_source_type() { |
117 return context_menu_source_type_; | 131 return context_menu_source_type_; |
118 } | 132 } |
119 bool has_host_context_menu_location() { | 133 bool has_host_context_menu_location() { |
120 return has_host_context_menu_location_; | 134 return has_host_context_menu_location_; |
121 } | 135 } |
122 gfx::Point host_context_menu_location() { | 136 gfx::Point host_context_menu_location() { |
123 return host_context_menu_location_; | 137 return host_context_menu_location_; |
124 } | 138 } |
125 | 139 |
| 140 // ScreenInfo exposed so it can be passed to subframe RenderWidgets. |
| 141 blink::WebScreenInfo screen_info() const { return screen_info_; } |
| 142 |
126 // Functions to track out-of-process frames for special notifications. | 143 // Functions to track out-of-process frames for special notifications. |
127 void RegisterRenderFrameProxy(RenderFrameProxy* proxy); | 144 void RegisterRenderFrameProxy(RenderFrameProxy* proxy); |
128 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy); | 145 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy); |
129 | 146 |
130 // Functions to track all RenderFrame objects associated with this | 147 // Functions to track all RenderFrame objects associated with this |
131 // RenderWidget. | 148 // RenderWidget. |
132 void RegisterRenderFrame(RenderFrameImpl* frame); | 149 void RegisterRenderFrame(RenderFrameImpl* frame); |
133 void UnregisterRenderFrame(RenderFrameImpl* frame); | 150 void UnregisterRenderFrame(RenderFrameImpl* frame); |
134 | 151 |
135 #if defined(VIDEO_HOLE) | 152 #if defined(VIDEO_HOLE) |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 ui::MenuSourceType context_menu_source_type_; | 795 ui::MenuSourceType context_menu_source_type_; |
779 bool has_host_context_menu_location_; | 796 bool has_host_context_menu_location_; |
780 gfx::Point host_context_menu_location_; | 797 gfx::Point host_context_menu_location_; |
781 | 798 |
782 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 799 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
783 }; | 800 }; |
784 | 801 |
785 } // namespace content | 802 } // namespace content |
786 | 803 |
787 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 804 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |