diff options
Diffstat (limited to 'chrome/renderer/render_widget.cc')
-rw-r--r-- | chrome/renderer/render_widget.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 863e73d..cd722ba 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -180,8 +180,10 @@ void RenderWidget::OnClose() { closing_ = true; // Browser correspondence is no longer needed at this point. - if (routing_id_ != MSG_ROUTING_NONE) + if (routing_id_ != MSG_ROUTING_NONE) { render_thread_->RemoveRoute(routing_id_); + SetHidden(false); + } // If there is a Send call on the stack, then it could be dangerous to close // now. Post a task that only gets invoked when there are no nested message @@ -203,7 +205,7 @@ void RenderWidget::OnResize(const gfx::Size& new_size, resizer_rect_ = resizer_rect; // TODO(darin): We should not need to reset this here. - is_hidden_ = false; + SetHidden(false); needs_repainting_on_restore_ = false; // We shouldn't be asked to resize to our current size. @@ -232,7 +234,7 @@ void RenderWidget::OnResize(const gfx::Size& new_size, void RenderWidget::OnWasHidden() { // Go into a mode where we stop generating paint and scrolling events. - is_hidden_ = true; + SetHidden(true); } void RenderWidget::OnWasRestored(bool needs_repainting) { @@ -241,7 +243,7 @@ void RenderWidget::OnWasRestored(bool needs_repainting) { return; // See OnWasHidden - is_hidden_ = false; + SetHidden(false); if (!needs_repainting && !needs_repainting_on_restore_) return; @@ -736,6 +738,18 @@ void RenderWidget::OnSetTextDirection(WebTextDirection direction) { webwidget_->setTextDirection(direction); } +void RenderWidget::SetHidden(bool hidden) { + if (is_hidden_ == hidden) + return; + + // The status has changed. Tell the RenderThread about it. + is_hidden_ = hidden; + if (is_hidden_) + render_thread_->WidgetHidden(); + else + render_thread_->WidgetRestored(); +} + void RenderWidget::SetBackground(const SkBitmap& background) { background_ = background; // Generate a full repaint. |