| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 // Called by Init and subclasses to perform initialization. | 148 // Called by Init and subclasses to perform initialization. |
| 149 void DoInit(int32 opener_id, | 149 void DoInit(int32 opener_id, |
| 150 WebKit::WebWidget* web_widget, | 150 WebKit::WebWidget* web_widget, |
| 151 IPC::SyncMessage* create_widget_message); | 151 IPC::SyncMessage* create_widget_message); |
| 152 | 152 |
| 153 // Finishes creation of a pending view started with Init. | 153 // Finishes creation of a pending view started with Init. |
| 154 void CompleteInit(gfx::NativeViewId parent, | 154 void CompleteInit(gfx::NativeViewId parent, |
| 155 gfx::PluginWindowHandle compositing_surface); | 155 gfx::PluginWindowHandle compositing_surface); |
| 156 | 156 |
| 157 // Sets whether this RenderWidget has been swapped out to be displayed by |
| 158 // a RenderWidget in a different process. If so, no new IPC messages will be |
| 159 // sent (only ACKs) and the process is free to exit when there are no other |
| 160 // active RenderWidgets. |
| 161 void SetSwappedOut(bool is_swapped_out); |
| 162 |
| 163 // Allows certain IPC messages to be sent while swapped out, in case they |
| 164 // are needed to keep the browser and renderer in a consistent state. |
| 165 virtual bool CanSendWhileSwappedOut(IPC::Message* message); |
| 166 |
| 157 // Paints the given rectangular region of the WebWidget into canvas (a | 167 // Paints the given rectangular region of the WebWidget into canvas (a |
| 158 // shared memory segment returned by AllocPaintBuf on Windows). The caller | 168 // shared memory segment returned by AllocPaintBuf on Windows). The caller |
| 159 // must ensure that the given rect fits within the bounds of the WebWidget. | 169 // must ensure that the given rect fits within the bounds of the WebWidget. |
| 160 void PaintRect(const gfx::Rect& rect, const gfx::Point& canvas_origin, | 170 void PaintRect(const gfx::Rect& rect, const gfx::Point& canvas_origin, |
| 161 skia::PlatformCanvas* canvas); | 171 skia::PlatformCanvas* canvas); |
| 162 | 172 |
| 163 // Paints a border at the given rect for debugging purposes. | 173 // Paints a border at the given rect for debugging purposes. |
| 164 void PaintDebugBorder(const gfx::Rect& rect, skia::PlatformCanvas* canvas); | 174 void PaintDebugBorder(const gfx::Rect& rect, skia::PlatformCanvas* canvas); |
| 165 | 175 |
| 166 void AnimationCallback(); | 176 void AnimationCallback(); |
| 167 void AnimateIfNeeded(); | 177 void AnimateIfNeeded(); |
| 168 void CallDoDeferredUpdate(); | 178 void CallDoDeferredUpdate(); |
| 169 void DoDeferredUpdate(); | 179 void DoDeferredUpdate(); |
| 170 void DoDeferredClose(); | 180 void DoDeferredClose(); |
| 171 void DoDeferredSetWindowRect(const WebKit::WebRect& pos); | 181 void DoDeferredSetWindowRect(const WebKit::WebRect& pos); |
| 172 | 182 |
| 173 // Set the background of the render widget to a bitmap. The bitmap will be | 183 // Set the background of the render widget to a bitmap. The bitmap will be |
| 174 // tiled in both directions if it isn't big enough to fill the area. This is | 184 // tiled in both directions if it isn't big enough to fill the area. This is |
| 175 // mainly intended to be used in conjuction with WebView::SetIsTransparent(). | 185 // mainly intended to be used in conjuction with WebView::SetIsTransparent(). |
| 176 virtual void SetBackground(const SkBitmap& bitmap); | 186 virtual void SetBackground(const SkBitmap& bitmap); |
| 177 | 187 |
| 178 // RenderWidget IPC message handlers | 188 // RenderWidget IPC message handlers |
| 179 void OnClose(); | 189 void OnClose(); |
| 180 void OnCreatingNewAck(gfx::NativeViewId parent, | 190 void OnCreatingNewAck(gfx::NativeViewId parent, |
| 181 gfx::PluginWindowHandle compositing_surface); | 191 gfx::PluginWindowHandle compositing_surface); |
| 182 virtual void OnResize(const gfx::Size& new_size, | 192 virtual void OnResize(const gfx::Size& new_size, |
| 183 const gfx::Rect& resizer_rect); | 193 const gfx::Rect& resizer_rect); |
| 184 virtual void OnWasHidden(); | 194 virtual void OnWasHidden(); |
| 185 virtual void OnWasRestored(bool needs_repainting); | 195 virtual void OnWasRestored(bool needs_repainting); |
| 196 virtual void OnWasSwappedOut(); |
| 186 void OnUpdateRectAck(); | 197 void OnUpdateRectAck(); |
| 187 void OnCreateVideoAck(int32 video_id); | 198 void OnCreateVideoAck(int32 video_id); |
| 188 void OnUpdateVideoAck(int32 video_id); | 199 void OnUpdateVideoAck(int32 video_id); |
| 189 void OnRequestMoveAck(); | 200 void OnRequestMoveAck(); |
| 190 void OnHandleInputEvent(const IPC::Message& message); | 201 void OnHandleInputEvent(const IPC::Message& message); |
| 191 void OnMouseCaptureLost(); | 202 void OnMouseCaptureLost(); |
| 192 virtual void OnSetFocus(bool enable); | 203 virtual void OnSetFocus(bool enable); |
| 193 void OnSetInputMethodActive(bool is_active); | 204 void OnSetInputMethodActive(bool is_active); |
| 194 void OnImeSetComposition( | 205 void OnImeSetComposition( |
| 195 const string16& text, | 206 const string16& text, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // Indicates whether we have been focused/unfocused by the browser. | 347 // Indicates whether we have been focused/unfocused by the browser. |
| 337 bool has_focus_; | 348 bool has_focus_; |
| 338 | 349 |
| 339 // Are we currently handling an input event? | 350 // Are we currently handling an input event? |
| 340 bool handling_input_event_; | 351 bool handling_input_event_; |
| 341 | 352 |
| 342 // True if we have requested this widget be closed. No more messages will | 353 // True if we have requested this widget be closed. No more messages will |
| 343 // be sent, except for a Close. | 354 // be sent, except for a Close. |
| 344 bool closing_; | 355 bool closing_; |
| 345 | 356 |
| 357 // Whether this RenderWidget is currently swapped out, such that the view is |
| 358 // being rendered by another process. If all RenderWidgets in a process are |
| 359 // swapped out, the process can exit. |
| 360 bool is_swapped_out_; |
| 361 |
| 346 // Indicates if an input method is active in the browser process. | 362 // Indicates if an input method is active in the browser process. |
| 347 bool input_method_is_active_; | 363 bool input_method_is_active_; |
| 348 | 364 |
| 349 // Stores the current text input type of |webwidget_|. | 365 // Stores the current text input type of |webwidget_|. |
| 350 WebKit::WebTextInputType text_input_type_; | 366 WebKit::WebTextInputType text_input_type_; |
| 351 | 367 |
| 352 // Stores the current caret bounds of input focus. | 368 // Stores the current caret bounds of input focus. |
| 353 WebKit::WebRect caret_bounds_; | 369 WebKit::WebRect caret_bounds_; |
| 354 | 370 |
| 355 // The kind of popup this widget represents, NONE if not a popup. | 371 // The kind of popup this widget represents, NONE if not a popup. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 381 gfx::PluginWindowHandle compositing_surface_; | 397 gfx::PluginWindowHandle compositing_surface_; |
| 382 | 398 |
| 383 base::Time animation_floor_time_; | 399 base::Time animation_floor_time_; |
| 384 bool animation_update_pending_; | 400 bool animation_update_pending_; |
| 385 bool animation_task_posted_; | 401 bool animation_task_posted_; |
| 386 | 402 |
| 387 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 403 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 388 }; | 404 }; |
| 389 | 405 |
| 390 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 406 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |