Mac: Use Mavericks occlusion APIs for power savings.
Use NSWindowDidChangeOcclusionStateNotification (new in 10.9 Mavericks) to detect when the application is hidden, the window is minimized or obscured by another window. Send the WasHidden to the WebContentsImpl, because this will take into account tab capture. When RenderWidgetHostViewMac::WasHidden is called, the previous behavior was to destroy the BrowserCompositorViewMac. This has the undesirable effect of creating a white flash when a hidden window is re-exposed. To prevent this, only destroy the BrowserCompositorViewMac when the the RenderWidgetHostViewMac is removed from all NSWindows. Manage the state of BrowserCompositorViewMac explicitly as being Active (previously whenever it existed), Suspended (the new state where it is kept around, but the RWH and DFH are hidden), and Destroyed (previously wherever it did not exist). Move some 10.7 APIs to base because they belong there, not in content. BUG=310374 Review URL: https://codereview.chromium.org/684343002 Cr-Commit-Position: refs/heads/master@{#302160}
Showing
Please register or sign in to comment