| 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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 } | 635 } |
| 636 | 636 |
| 637 - (void)viewWillMoveToWindow:(NSWindow*)newWindow { | 637 - (void)viewWillMoveToWindow:(NSWindow*)newWindow { |
| 638 NSWindow* oldWindow = [self window]; | 638 NSWindow* oldWindow = [self window]; |
| 639 | 639 |
| 640 NSNotificationCenter* notificationCenter = | 640 NSNotificationCenter* notificationCenter = |
| 641 [NSNotificationCenter defaultCenter]; | 641 [NSNotificationCenter defaultCenter]; |
| 642 | 642 |
| 643 // Occlusion is highly undesirable for browser tests, since it will | 643 // Occlusion is highly undesirable for browser tests, since it will |
| 644 // flakily change test behavior. | 644 // flakily change test behavior. |
| 645 static bool isDisabled = base::CommandLine::ForCurrentProcess()->HasSwitch( | 645 static bool isDisabled = |
| 646 switches::kDisableBackgroundingOccludedWindowsForTesting); | 646 1 || |
| 647 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 648 switches::kDisableBackgroundingOccludedWindowsForTesting); |
| 647 | 649 |
| 648 if (!isDisabled) { | 650 if (!isDisabled) { |
| 649 if (oldWindow) { | 651 if (oldWindow) { |
| 650 [notificationCenter | 652 [notificationCenter |
| 651 removeObserver:self | 653 removeObserver:self |
| 652 name:NSWindowDidChangeOcclusionStateNotification | 654 name:NSWindowDidChangeOcclusionStateNotification |
| 653 object:oldWindow]; | 655 object:oldWindow]; |
| 654 } | 656 } |
| 655 if (newWindow) { | 657 if (newWindow) { |
| 656 [notificationCenter | 658 [notificationCenter |
| (...skipping 24 matching lines...) Expand all Loading... |
| 681 | 683 |
| 682 - (void)viewDidHide { | 684 - (void)viewDidHide { |
| 683 [self updateWebContentsVisibility]; | 685 [self updateWebContentsVisibility]; |
| 684 } | 686 } |
| 685 | 687 |
| 686 - (void)viewDidUnhide { | 688 - (void)viewDidUnhide { |
| 687 [self updateWebContentsVisibility]; | 689 [self updateWebContentsVisibility]; |
| 688 } | 690 } |
| 689 | 691 |
| 690 @end | 692 @end |
| OLD | NEW |