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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 666123003: Mac: Use Mavericks occlusion APIs for power savings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move occlusion handling to WebContentsViewMac Created 6 years, 2 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 | « base/mac/sdk_forward_declarations.mm ('k') | content/browser/web_contents/web_contents_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 964af70950fd317c6cae5be9480859c29253accf..2e0c88997552c1dd22bf65a39ab600f49d96b5cb 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -793,14 +793,15 @@ void RenderWidgetHostViewMac::WasShown() {
}
void RenderWidgetHostViewMac::WasHidden() {
- if (render_widget_host_->is_hidden())
- return;
-
- DestroyBrowserCompositorView();
+ // We want to call DestroyBrowserCompositorView on inactive tabs, but not on
+ // an active tab that is being occluded.
+ if (![cocoa_view_ window])
+ DestroyBrowserCompositorView();
// If we have a renderer, then inform it that we are being hidden so it can
// reduce its resource utilization.
- render_widget_host_->WasHidden();
+ if (!render_widget_host_->is_hidden())
+ render_widget_host_->WasHidden();
}
void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) {
« no previous file with comments | « base/mac/sdk_forward_declarations.mm ('k') | content/browser/web_contents/web_contents_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698