Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9930)

Unified Diff: chrome/renderer/render_widget.cc

Issue 174303: Modify the RenderThread to track the number of widgets... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/render_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_widget.cc
===================================================================
--- chrome/renderer/render_widget.cc (revision 24223)
+++ chrome/renderer/render_widget.cc (working copy)
@@ -180,8 +180,10 @@
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 @@
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::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 @@
return;
// See OnWasHidden
- is_hidden_ = false;
+ SetHidden(false);
if (!needs_repainting && !needs_repainting_on_restore_)
return;
@@ -736,6 +738,18 @@
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.
« no previous file with comments | « chrome/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698