OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 static RenderWidget* Create(int32 opener_id, | 70 static RenderWidget* Create(int32 opener_id, |
71 RenderThreadBase* render_thread, | 71 RenderThreadBase* render_thread, |
72 WebKit::WebPopupType popup_type); | 72 WebKit::WebPopupType popup_type); |
73 | 73 |
74 // Creates a WebWidget based on the popup type. | 74 // Creates a WebWidget based on the popup type. |
75 static WebKit::WebWidget* CreateWebWidget(RenderWidget* render_widget); | 75 static WebKit::WebWidget* CreateWebWidget(RenderWidget* render_widget); |
76 | 76 |
77 // The compositing surface assigned by the RenderWidgetHost | 77 // The compositing surface assigned by the RenderWidgetHost |
78 // (or RenderViewHost). Will be gfx::kNullPluginWindow if not assigned yet, | 78 // (or RenderViewHost). Will be gfx::kNullPluginWindow if not assigned yet, |
79 // in which case we should not create any GPU command buffers with it. | 79 // in which case we should not create any GPU command buffers with it. |
80 gfx::PluginWindowHandle compositing_surface() const { | |
81 return compositing_surface_; | |
82 } | |
83 | |
84 // The routing ID assigned by the RenderProcess. Will be MSG_ROUTING_NONE if | 80 // The routing ID assigned by the RenderProcess. Will be MSG_ROUTING_NONE if |
85 // not yet assigned a view ID, in which case, the process MUST NOT send | 81 // not yet assigned a view ID, in which case, the process MUST NOT send |
86 // messages with this ID to the parent. | 82 // messages with this ID to the parent. |
87 int32 routing_id() const { | 83 int32 routing_id() const { |
88 return routing_id_; | 84 return routing_id_; |
89 } | 85 } |
90 | 86 |
91 // May return NULL when the window is closing. | 87 // May return NULL when the window is closing. |
92 WebKit::WebWidget* webwidget() const { return webwidget_; } | 88 WebKit::WebWidget* webwidget() const { return webwidget_; } |
93 gfx::NativeViewId host_window() const { return host_window_; } | 89 gfx::NativeViewId host_window() const { return host_window_; } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // Initializes this view with the given opener. CompleteInit must be called | 142 // Initializes this view with the given opener. CompleteInit must be called |
147 // later. | 143 // later. |
148 void Init(int32 opener_id); | 144 void Init(int32 opener_id); |
149 | 145 |
150 // Called by Init and subclasses to perform initialization. | 146 // Called by Init and subclasses to perform initialization. |
151 void DoInit(int32 opener_id, | 147 void DoInit(int32 opener_id, |
152 WebKit::WebWidget* web_widget, | 148 WebKit::WebWidget* web_widget, |
153 IPC::SyncMessage* create_widget_message); | 149 IPC::SyncMessage* create_widget_message); |
154 | 150 |
155 // Finishes creation of a pending view started with Init. | 151 // Finishes creation of a pending view started with Init. |
156 void CompleteInit(gfx::NativeViewId parent, | 152 void CompleteInit(gfx::NativeViewId parent); |
157 gfx::PluginWindowHandle compositing_surface); | |
158 | 153 |
159 // Sets whether this RenderWidget has been swapped out to be displayed by | 154 // Sets whether this RenderWidget has been swapped out to be displayed by |
160 // a RenderWidget in a different process. If so, no new IPC messages will be | 155 // a RenderWidget in a different process. If so, no new IPC messages will be |
161 // sent (only ACKs) and the process is free to exit when there are no other | 156 // sent (only ACKs) and the process is free to exit when there are no other |
162 // active RenderWidgets. | 157 // active RenderWidgets. |
163 void SetSwappedOut(bool is_swapped_out); | 158 void SetSwappedOut(bool is_swapped_out); |
164 | 159 |
165 // Paints the given rectangular region of the WebWidget into canvas (a | 160 // Paints the given rectangular region of the WebWidget into canvas (a |
166 // shared memory segment returned by AllocPaintBuf on Windows). The caller | 161 // shared memory segment returned by AllocPaintBuf on Windows). The caller |
167 // must ensure that the given rect fits within the bounds of the WebWidget. | 162 // must ensure that the given rect fits within the bounds of the WebWidget. |
(...skipping 12 matching lines...) Expand all Loading... |
180 void DoDeferredClose(); | 175 void DoDeferredClose(); |
181 void DoDeferredSetWindowRect(const WebKit::WebRect& pos); | 176 void DoDeferredSetWindowRect(const WebKit::WebRect& pos); |
182 | 177 |
183 // Set the background of the render widget to a bitmap. The bitmap will be | 178 // Set the background of the render widget to a bitmap. The bitmap will be |
184 // tiled in both directions if it isn't big enough to fill the area. This is | 179 // tiled in both directions if it isn't big enough to fill the area. This is |
185 // mainly intended to be used in conjuction with WebView::SetIsTransparent(). | 180 // mainly intended to be used in conjuction with WebView::SetIsTransparent(). |
186 virtual void SetBackground(const SkBitmap& bitmap); | 181 virtual void SetBackground(const SkBitmap& bitmap); |
187 | 182 |
188 // RenderWidget IPC message handlers | 183 // RenderWidget IPC message handlers |
189 void OnClose(); | 184 void OnClose(); |
190 void OnCreatingNewAck(gfx::NativeViewId parent, | 185 void OnCreatingNewAck(gfx::NativeViewId parent); |
191 gfx::PluginWindowHandle compositing_surface); | |
192 virtual void OnResize(const gfx::Size& new_size, | 186 virtual void OnResize(const gfx::Size& new_size, |
193 const gfx::Rect& resizer_rect); | 187 const gfx::Rect& resizer_rect); |
194 virtual void OnWasHidden(); | 188 virtual void OnWasHidden(); |
195 virtual void OnWasRestored(bool needs_repainting); | 189 virtual void OnWasRestored(bool needs_repainting); |
196 virtual void OnWasSwappedOut(); | 190 virtual void OnWasSwappedOut(); |
197 void OnUpdateRectAck(); | 191 void OnUpdateRectAck(); |
198 void OnCreateVideoAck(int32 video_id); | 192 void OnCreateVideoAck(int32 video_id); |
199 void OnUpdateVideoAck(int32 video_id); | 193 void OnUpdateVideoAck(int32 video_id); |
200 void OnRequestMoveAck(); | 194 void OnRequestMoveAck(); |
201 void OnHandleInputEvent(const IPC::Message& message); | 195 void OnHandleInputEvent(const IPC::Message& message); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 413 |
420 scoped_ptr<IPC::Message> pending_input_event_ack_; | 414 scoped_ptr<IPC::Message> pending_input_event_ack_; |
421 | 415 |
422 // Indicates if the next sequence of Char events should be suppressed or not. | 416 // Indicates if the next sequence of Char events should be suppressed or not. |
423 bool suppress_next_char_events_; | 417 bool suppress_next_char_events_; |
424 | 418 |
425 // Set to true if painting to the window is handled by the accelerated | 419 // Set to true if painting to the window is handled by the accelerated |
426 // compositor. | 420 // compositor. |
427 bool is_accelerated_compositing_active_; | 421 bool is_accelerated_compositing_active_; |
428 | 422 |
429 // Handle to a surface that is drawn to when accelerated compositing is | |
430 // active. | |
431 gfx::PluginWindowHandle compositing_surface_; | |
432 | |
433 base::Time animation_floor_time_; | 423 base::Time animation_floor_time_; |
434 bool animation_update_pending_; | 424 bool animation_update_pending_; |
435 bool animation_task_posted_; | 425 bool animation_task_posted_; |
436 bool invalidation_task_posted_; | 426 bool invalidation_task_posted_; |
437 | 427 |
438 bool has_disable_gpu_vsync_switch_; | 428 bool has_disable_gpu_vsync_switch_; |
439 base::TimeTicks last_do_deferred_update_time_; | 429 base::TimeTicks last_do_deferred_update_time_; |
440 | 430 |
441 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 431 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
442 }; | 432 }; |
443 | 433 |
444 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 434 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |