| 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 "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 6 | 6 |
| 7 #include <cmath> // floor | 7 #include <cmath> // floor |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 367 } |
| 368 | 368 |
| 369 - (void)setNewTabButton:(NewTabButton*)button { | 369 - (void)setNewTabButton:(NewTabButton*)button { |
| 370 newTabButton_.reset([button retain]); | 370 newTabButton_.reset([button retain]); |
| 371 } | 371 } |
| 372 | 372 |
| 373 - (NSVisualEffectView*)visualEffectView { | 373 - (NSVisualEffectView*)visualEffectView { |
| 374 // NSVisualEffectView is only used in Material Design, and only available on | 374 // NSVisualEffectView is only used in Material Design, and only available on |
| 375 // OS X 10.10 and higher. | 375 // OS X 10.10 and higher. |
| 376 if (!ui::MaterialDesignController::IsModeMaterial() || | 376 if (!ui::MaterialDesignController::IsModeMaterial() || |
| 377 !base::mac::IsOSYosemiteOrLater()) { | 377 !base::mac::IsAtLeastOS10_10()) { |
| 378 return nil; | 378 return nil; |
| 379 } | 379 } |
| 380 | 380 |
| 381 NSView* rootView = [[[self window] contentView] superview]; | 381 NSView* rootView = [[[self window] contentView] superview]; |
| 382 Class nsVisualEffectViewClass = NSClassFromString(@"NSVisualEffectView"); | 382 Class nsVisualEffectViewClass = NSClassFromString(@"NSVisualEffectView"); |
| 383 DCHECK(nsVisualEffectViewClass); | 383 DCHECK(nsVisualEffectViewClass); |
| 384 for (NSView* view in [rootView subviews]) { | 384 for (NSView* view in [rootView subviews]) { |
| 385 if ([view isKindOfClass:nsVisualEffectViewClass]) { | 385 if ([view isKindOfClass:nsVisualEffectViewClass]) { |
| 386 return base::mac::ObjCCast<NSVisualEffectView>(view); | 386 return base::mac::ObjCCast<NSVisualEffectView>(view); |
| 387 } | 387 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 if (visualEffectsDisabledForFullscreen_ || | 444 if (visualEffectsDisabledForFullscreen_ || |
| 445 themeProvider->HasCustomImage(IDR_THEME_FRAME) || | 445 themeProvider->HasCustomImage(IDR_THEME_FRAME) || |
| 446 themeProvider->HasCustomColor(ThemeProperties::COLOR_FRAME)) { | 446 themeProvider->HasCustomColor(ThemeProperties::COLOR_FRAME)) { |
| 447 [visualEffectView setState:NSVisualEffectStateInactive]; | 447 [visualEffectView setState:NSVisualEffectStateInactive]; |
| 448 } else { | 448 } else { |
| 449 [visualEffectView setState:NSVisualEffectStateFollowsWindowActiveState]; | 449 [visualEffectView setState:NSVisualEffectStateFollowsWindowActiveState]; |
| 450 } | 450 } |
| 451 } | 451 } |
| 452 | 452 |
| 453 @end | 453 @end |
| OLD | NEW |