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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 public IPC::Sender, | 90 public IPC::Sender, |
91 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient), | 91 NON_EXPORTED_BASE(virtual public blink::WebWidgetClient), |
92 public base::RefCounted<RenderWidget> { | 92 public base::RefCounted<RenderWidget> { |
93 public: | 93 public: |
94 // Creates a new RenderWidget. The opener_id is the routing ID of the | 94 // Creates a new RenderWidget. The opener_id is the routing ID of the |
95 // RenderView that this widget lives inside. | 95 // RenderView that this widget lives inside. |
96 static RenderWidget* Create(int32 opener_id, | 96 static RenderWidget* Create(int32 opener_id, |
97 blink::WebPopupType popup_type, | 97 blink::WebPopupType popup_type, |
98 const blink::WebScreenInfo& screen_info); | 98 const blink::WebScreenInfo& screen_info); |
99 | 99 |
| 100 // Creates a new RenderWidget that will be attached to a RenderFrame. |
| 101 static RenderWidget* CreateForFrame(int routing_id, |
| 102 int surface_id, |
| 103 bool hidden, |
| 104 const blink::WebScreenInfo& screen_info); |
| 105 |
100 // Creates a WebWidget based on the popup type. | 106 // Creates a WebWidget based on the popup type. |
101 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); | 107 static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); |
102 | 108 |
103 int32 routing_id() const { return routing_id_; } | 109 int32 routing_id() const { return routing_id_; } |
104 int32 surface_id() const { return surface_id_; } | 110 int32 surface_id() const { return surface_id_; } |
105 blink::WebWidget* webwidget() const { return webwidget_; } | 111 blink::WebWidget* webwidget() const { return webwidget_; } |
106 gfx::Size size() const { return size_; } | 112 gfx::Size size() const { return size_; } |
107 bool has_focus() const { return has_focus_; } | 113 bool has_focus() const { return has_focus_; } |
108 bool is_fullscreen() const { return is_fullscreen_; } | 114 bool is_fullscreen() const { return is_fullscreen_; } |
109 bool is_hidden() const { return is_hidden_; } | 115 bool is_hidden() const { return is_hidden_; } |
110 bool handling_input_event() const { return handling_input_event_; } | 116 bool handling_input_event() const { return handling_input_event_; } |
111 // Temporary for debugging purposes... | 117 // Temporary for debugging purposes... |
112 bool closing() const { return closing_; } | 118 bool closing() const { return closing_; } |
113 bool is_swapped_out() { return is_swapped_out_; } | 119 bool is_swapped_out() { return is_swapped_out_; } |
114 ui::MenuSourceType context_menu_source_type() { | 120 ui::MenuSourceType context_menu_source_type() { |
115 return context_menu_source_type_; | 121 return context_menu_source_type_; |
116 } | 122 } |
117 bool has_host_context_menu_location() { | 123 bool has_host_context_menu_location() { |
118 return has_host_context_menu_location_; | 124 return has_host_context_menu_location_; |
119 } | 125 } |
120 gfx::Point host_context_menu_location() { | 126 gfx::Point host_context_menu_location() { |
121 return host_context_menu_location_; | 127 return host_context_menu_location_; |
122 } | 128 } |
123 | 129 |
| 130 // ScreenInfo exposed so it can be passed to subframe RenderWidgets. |
| 131 blink::WebScreenInfo screen_info() const { return screen_info_; } |
| 132 |
124 // Functions to track out-of-process frames for special notifications. | 133 // Functions to track out-of-process frames for special notifications. |
125 void RegisterRenderFrameProxy(RenderFrameProxy* proxy); | 134 void RegisterRenderFrameProxy(RenderFrameProxy* proxy); |
126 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy); | 135 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy); |
127 | 136 |
128 // Functions to track all RenderFrame objects associated with this | 137 // Functions to track all RenderFrame objects associated with this |
129 // RenderWidget. | 138 // RenderWidget. |
130 void RegisterRenderFrame(RenderFrameImpl* frame); | 139 void RegisterRenderFrame(RenderFrameImpl* frame); |
131 void UnregisterRenderFrame(RenderFrameImpl* frame); | 140 void UnregisterRenderFrame(RenderFrameImpl* frame); |
132 | 141 |
133 #if defined(VIDEO_HOLE) | 142 #if defined(VIDEO_HOLE) |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 ui::MenuSourceType context_menu_source_type_; | 759 ui::MenuSourceType context_menu_source_type_; |
751 bool has_host_context_menu_location_; | 760 bool has_host_context_menu_location_; |
752 gfx::Point host_context_menu_location_; | 761 gfx::Point host_context_menu_location_; |
753 | 762 |
754 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 763 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
755 }; | 764 }; |
756 | 765 |
757 } // namespace content | 766 } // namespace content |
758 | 767 |
759 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 768 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |