Chromium Code Reviews| 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..28ad79394d20a4b4899988382c8130d2ec6672a8 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)checkWebContentsShowState; |
| - (void)viewDidBecomeFirstResponder:(NSNotification*)notification; |
| - (content::WebContentsImpl*)webContents; |
| @end |
| @@ -611,6 +612,15 @@ void WebContentsViewMac::CloseTab() { |
| FocusThroughTabTraversal(direction == NSSelectingPrevious); |
| } |
| +- (void)checkWebContentsShowState { |
|
Avi (use Gerrit)
2016/02/26 17:50:23
We're not checking it, we're updating it, and I do
tapted
2016/02/29 06:49:00
Done.
|
| + 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 checkWebContentsShowState]; |
| +} |
| + |
| +- (void)viewDidHide { |
| + [self checkWebContentsShowState]; |
| +} |
| + |
| +- (void)viewDidUnhide { |
| + [self checkWebContentsShowState]; |
| +} |
| + |
| @end |