OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "app/surface/transport_dib.h" | 10 #include "app/surface/transport_dib.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 void Focus(); | 198 void Focus(); |
199 void Blur(); | 199 void Blur(); |
200 void LostCapture(); | 200 void LostCapture(); |
201 | 201 |
202 // Notifies the RenderWidgetHost that the View was destroyed. | 202 // Notifies the RenderWidgetHost that the View was destroyed. |
203 void ViewDestroyed(); | 203 void ViewDestroyed(); |
204 | 204 |
205 // Indicates if the page has finished loading. | 205 // Indicates if the page has finished loading. |
206 void SetIsLoading(bool is_loading); | 206 void SetIsLoading(bool is_loading); |
207 | 207 |
| 208 // This tells the renderer to paint into a bitmap and return it, |
| 209 // regardless of whether the tab is hidden or not. It returns the |
| 210 // bitmap scaled so it matches the requested size, so that the |
| 211 // scaling happens on the rendering thread. When the bitmap is |
| 212 // ready, the renderer sends a PaintAtSizeACK to this host, and the |
| 213 // painting observer is notified. Note that this bypasses most of |
| 214 // the update logic that is normally invoked, and doesn't put the |
| 215 // results into the backing store. |
| 216 void PaintAtSize(TransportDIB::Handle dib_handle, const gfx::Size& size); |
| 217 |
208 // Get access to the widget's backing store. If a resize is in progress, | 218 // Get access to the widget's backing store. If a resize is in progress, |
209 // then the current size of the backing store may be less than the size of | 219 // then the current size of the backing store may be less than the size of |
210 // the widget's view. If you pass |force_create| as true, then the backing | 220 // the widget's view. If you pass |force_create| as true, then the backing |
211 // store will be created if it doesn't exist. Otherwise, NULL will be returned | 221 // store will be created if it doesn't exist. Otherwise, NULL will be returned |
212 // if the backing store doesn't already exist. It will also return NULL if the | 222 // if the backing store doesn't already exist. It will also return NULL if the |
213 // backing store could not be created. | 223 // backing store could not be created. |
214 BackingStore* GetBackingStore(bool force_create); | 224 BackingStore* GetBackingStore(bool force_create); |
215 | 225 |
216 // Allocate a new backing store of the given size. Returns NULL on failure | 226 // Allocate a new backing store of the given size. Returns NULL on failure |
217 // (for example, if we don't currently have a RenderWidgetHostView.) | 227 // (for example, if we don't currently have a RenderWidgetHostView.) |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 protected: | 416 protected: |
407 // true if a renderer has once been valid. We use this flag to display a sad | 417 // true if a renderer has once been valid. We use this flag to display a sad |
408 // tab only when we lose our renderer and not if a paint occurs during | 418 // tab only when we lose our renderer and not if a paint occurs during |
409 // initialization. | 419 // initialization. |
410 bool renderer_initialized_; | 420 bool renderer_initialized_; |
411 | 421 |
412 private: | 422 private: |
413 FRIEND_TEST(RenderWidgetHostTest, Resize); | 423 FRIEND_TEST(RenderWidgetHostTest, Resize); |
414 FRIEND_TEST(RenderWidgetHostTest, ResizeThenCrash); | 424 FRIEND_TEST(RenderWidgetHostTest, ResizeThenCrash); |
415 FRIEND_TEST(RenderWidgetHostTest, HiddenPaint); | 425 FRIEND_TEST(RenderWidgetHostTest, HiddenPaint); |
| 426 FRIEND_TEST(RenderWidgetHostTest, PaintAtSize); |
416 | 427 |
417 // Tell this object to destroy itself. | 428 // Tell this object to destroy itself. |
418 void Destroy(); | 429 void Destroy(); |
419 | 430 |
420 // Checks whether the renderer is hung and calls NotifyRendererUnresponsive | 431 // Checks whether the renderer is hung and calls NotifyRendererUnresponsive |
421 // if it is. | 432 // if it is. |
422 void CheckRendererIsUnresponsive(); | 433 void CheckRendererIsUnresponsive(); |
423 | 434 |
424 // Called if we know the renderer is responsive. When we currently thing the | 435 // Called if we know the renderer is responsive. When we currently think the |
425 // renderer is unresponsive, this will clear that state and call | 436 // renderer is unresponsive, this will clear that state and call |
426 // NotifyRendererResponsive. | 437 // NotifyRendererResponsive. |
427 void RendererIsResponsive(); | 438 void RendererIsResponsive(); |
428 | 439 |
429 // IPC message handlers | 440 // IPC message handlers |
430 void OnMsgRenderViewReady(); | 441 void OnMsgRenderViewReady(); |
431 void OnMsgRenderViewGone(); | 442 void OnMsgRenderViewGone(); |
432 void OnMsgClose(); | 443 void OnMsgClose(); |
433 void OnMsgRequestMove(const gfx::Rect& pos); | 444 void OnMsgRequestMove(const gfx::Rect& pos); |
| 445 void OnMsgPaintAtSizeAck(const TransportDIB::Handle& dib_handle, |
| 446 const gfx::Size& size); |
434 void OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 447 void OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
435 void OnMsgCreateVideo(const gfx::Size& size); | 448 void OnMsgCreateVideo(const gfx::Size& size); |
436 void OnMsgUpdateVideo(TransportDIB::Id bitmap, const gfx::Rect& bitmap_rect); | 449 void OnMsgUpdateVideo(TransportDIB::Id bitmap, const gfx::Rect& bitmap_rect); |
437 void OnMsgDestroyVideo(); | 450 void OnMsgDestroyVideo(); |
438 void OnMsgInputEventAck(const IPC::Message& message); | 451 void OnMsgInputEventAck(const IPC::Message& message); |
439 void OnMsgFocus(); | 452 void OnMsgFocus(); |
440 void OnMsgBlur(); | 453 void OnMsgBlur(); |
441 virtual void OnMsgFocusedNodeChanged(); | 454 virtual void OnMsgFocusedNodeChanged(); |
442 | 455 |
443 void OnMsgSetCursor(const WebCursor& cursor); | 456 void OnMsgSetCursor(const WebCursor& cursor); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 // changed. | 641 // changed. |
629 bool suppress_next_char_events_; | 642 bool suppress_next_char_events_; |
630 | 643 |
631 // Optional video YUV layer for used for out-of-process compositing. | 644 // Optional video YUV layer for used for out-of-process compositing. |
632 scoped_ptr<VideoLayer> video_layer_; | 645 scoped_ptr<VideoLayer> video_layer_; |
633 | 646 |
634 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 647 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
635 }; | 648 }; |
636 | 649 |
637 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 650 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |