| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <Carbon/Carbon.h> | 5 #import <Carbon/Carbon.h> |
| 6 | 6 |
| 7 #import "content/browser/web_contents/web_contents_view_mac.h" | 7 #import "content/browser/web_contents/web_contents_view_mac.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 name:NSWindowDidChangeOcclusionStateNotification | 620 name:NSWindowDidChangeOcclusionStateNotification |
| 621 object:newWindow]; | 621 object:newWindow]; |
| 622 } | 622 } |
| 623 } | 623 } |
| 624 } | 624 } |
| 625 | 625 |
| 626 - (void)windowChangedOcclusionState:(NSNotification*)notification { | 626 - (void)windowChangedOcclusionState:(NSNotification*)notification { |
| 627 DCHECK(base::mac::IsOSMavericksOrLater()); | 627 DCHECK(base::mac::IsOSMavericksOrLater()); |
| 628 NSWindow* window = [notification object]; | 628 NSWindow* window = [notification object]; |
| 629 WebContentsImpl* webContents = [self webContents]; | 629 WebContentsImpl* webContents = [self webContents]; |
| 630 if (window && webContents) { | 630 if (window && webContents && !webContents->IsBeingDestroyed()) { |
| 631 if ([window occlusionState] & NSWindowOcclusionStateVisible) { | 631 if ([window occlusionState] & NSWindowOcclusionStateVisible) { |
| 632 webContents->WasUnOccluded(); | 632 webContents->WasUnOccluded(); |
| 633 } else { | 633 } else { |
| 634 webContents->WasOccluded(); | 634 webContents->WasOccluded(); |
| 635 } | 635 } |
| 636 } | 636 } |
| 637 } | 637 } |
| 638 | 638 |
| 639 @end | 639 @end |
| OLD | NEW |