| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 [visualEffectView setMaterial:NSVisualEffectMaterialDark]; | 395 [visualEffectView setMaterial:NSVisualEffectMaterialDark]; |
| 396 [visualEffectView setAppearance: | 396 [visualEffectView setAppearance: |
| 397 [NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]]; | 397 [NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]]; |
| 398 } | 398 } |
| 399 } | 399 } |
| 400 | 400 |
| 401 // ThemedWindowDrawing implementation. | 401 // ThemedWindowDrawing implementation. |
| 402 | 402 |
| 403 - (void)windowDidChangeTheme { | 403 - (void)windowDidChangeTheme { |
| 404 [self setNeedsDisplay:YES]; | 404 [self setNeedsDisplay:YES]; |
| 405 [self updateVisualEffectState]; |
| 406 } |
| 405 | 407 |
| 408 - (void)windowDidChangeActive { |
| 409 [self setNeedsDisplay:YES]; |
| 410 } |
| 411 |
| 412 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)disabled { |
| 413 visualEffectsDisabledForFullscreen_ = disabled; |
| 414 [self updateVisualEffectState]; |
| 415 } |
| 416 |
| 417 - (void)updateVisualEffectState { |
| 406 // Configure the NSVisualEffectView so that it does nothing if the user has | 418 // Configure the NSVisualEffectView so that it does nothing if the user has |
| 407 // switched to a custom theme, or uses vibrancy if the user has switched back | 419 // switched to a custom theme, or uses vibrancy if the user has switched back |
| 408 // to the default theme. | 420 // to the default theme. |
| 409 NSVisualEffectView* visualEffectView = [self visualEffectView]; | 421 NSVisualEffectView* visualEffectView = [self visualEffectView]; |
| 410 const ui::ThemeProvider* themeProvider = [[self window] themeProvider]; | 422 const ui::ThemeProvider* themeProvider = [[self window] themeProvider]; |
| 411 if (!visualEffectView || !themeProvider) { | 423 if (!visualEffectView || !themeProvider) { |
| 412 return; | 424 return; |
| 413 } | 425 } |
| 414 | 426 if (visualEffectsDisabledForFullscreen_ || |
| 415 if (themeProvider->HasCustomImage(IDR_THEME_FRAME) || | 427 themeProvider->HasCustomImage(IDR_THEME_FRAME) || |
| 416 themeProvider->HasCustomColor(ThemeProperties::COLOR_FRAME)) { | 428 themeProvider->HasCustomColor(ThemeProperties::COLOR_FRAME)) { |
| 417 [visualEffectView setState:NSVisualEffectStateInactive]; | 429 [visualEffectView setState:NSVisualEffectStateInactive]; |
| 418 } else { | 430 } else { |
| 419 [visualEffectView setState:NSVisualEffectStateFollowsWindowActiveState]; | 431 [visualEffectView setState:NSVisualEffectStateFollowsWindowActiveState]; |
| 420 } | 432 } |
| 421 } | 433 } |
| 422 | 434 |
| 423 - (void)windowDidChangeActive { | |
| 424 [self setNeedsDisplay:YES]; | |
| 425 } | |
| 426 | |
| 427 @end | 435 @end |
| OLD | NEW |