| Index: content/browser/web_contents/web_contents_view_mac.mm
|
| diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
|
| index 18e223817d3a149895aa0aec82cf47f6963d62ae..e569f0180976be0f65ea0738f6194f1c0d37e293 100644
|
| --- a/content/browser/web_contents/web_contents_view_mac.mm
|
| +++ b/content/browser/web_contents/web_contents_view_mac.mm
|
| @@ -67,6 +67,7 @@ STATIC_ASSERT_ENUM(NSDragOperationEvery, blink::WebDragOperationEvery);
|
| - (void)cancelDeferredClose;
|
| - (void)clearWebContentsView;
|
| - (void)closeTabAfterEvent;
|
| +- (void)updateWebContentsVisibility;
|
| - (void)viewDidBecomeFirstResponder:(NSNotification*)notification;
|
| - (content::WebContentsImpl*)webContents;
|
| @end
|
| @@ -611,6 +612,15 @@ void WebContentsViewMac::CloseTab() {
|
| FocusThroughTabTraversal(direction == NSSelectingPrevious);
|
| }
|
|
|
| +- (void)updateWebContentsVisibility {
|
| + WebContentsImpl* webContents = [self webContents];
|
| + if (!webContents || webContents->IsBeingDestroyed())
|
| + return;
|
| +
|
| + const bool viewVisible = [self window] && ![self isHiddenOrHasHiddenAncestor];
|
| + webContents->UpdateWebContentsVisibility(viewVisible);
|
| +}
|
| +
|
| // When the subviews require a layout, their size should be reset to the size
|
| // of this view. (It is possible for the size to get out of sync as an
|
| // optimization in preparation for an upcoming WebContentsView resize.
|
| @@ -659,4 +669,16 @@ void WebContentsViewMac::CloseTab() {
|
| }
|
| }
|
|
|
| +- (void)viewDidMoveToWindow {
|
| + [self updateWebContentsVisibility];
|
| +}
|
| +
|
| +- (void)viewDidHide {
|
| + [self updateWebContentsVisibility];
|
| +}
|
| +
|
| +- (void)viewDidUnhide {
|
| + [self updateWebContentsVisibility];
|
| +}
|
| +
|
| @end
|
|
|