| 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" |
| 11 #include "base/mac/mac_util.h" | 11 #include "base/mac/mac_util.h" |
| 12 #include "base/mac/sdk_forward_declarations.h" | 12 #include "base/mac/sdk_forward_declarations.h" |
| 13 #include "chrome/browser/themes/theme_properties.h" | 13 #include "chrome/browser/themes/theme_properties.h" |
| 14 #include "chrome/browser/themes/theme_service.h" | 14 #include "chrome/browser/themes/theme_service.h" |
| 15 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 15 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 16 #import "chrome/browser/ui/cocoa/browser_window_layout.h" |
| 16 #import "chrome/browser/ui/cocoa/new_tab_button.h" | 17 #import "chrome/browser/ui/cocoa/new_tab_button.h" |
| 17 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 18 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 18 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" | 19 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" |
| 19 #import "chrome/browser/ui/cocoa/view_id_util.h" | 20 #import "chrome/browser/ui/cocoa/view_id_util.h" |
| 20 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
| 21 #include "chrome/grit/theme_resources.h" | 22 #include "chrome/grit/theme_resources.h" |
| 22 #import "ui/base/cocoa/appkit_utils.h" | 23 #import "ui/base/cocoa/appkit_utils.h" |
| 23 #import "ui/base/cocoa/nsgraphics_context_additions.h" | 24 #import "ui/base/cocoa/nsgraphics_context_additions.h" |
| 24 #import "ui/base/cocoa/nsview_additions.h" | 25 #import "ui/base/cocoa/nsview_additions.h" |
| 25 #include "ui/base/l10n/l10n_util_mac.h" | 26 #include "ui/base/l10n/l10n_util_mac.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 345 |
| 345 - (void)setNewTabButton:(NewTabButton*)button { | 346 - (void)setNewTabButton:(NewTabButton*)button { |
| 346 newTabButton_.reset([button retain]); | 347 newTabButton_.reset([button retain]); |
| 347 } | 348 } |
| 348 | 349 |
| 349 - (NSVisualEffectView*)visualEffectView { | 350 - (NSVisualEffectView*)visualEffectView { |
| 350 // NSVisualEffectView is only available on OS X 10.10 and higher. | 351 // NSVisualEffectView is only available on OS X 10.10 and higher. |
| 351 if (!base::mac::IsAtLeastOS10_10()) | 352 if (!base::mac::IsAtLeastOS10_10()) |
| 352 return nil; | 353 return nil; |
| 353 | 354 |
| 354 NSView* rootView = [[[self window] contentView] superview]; | 355 NSView* rootView = [[self window] contentView]; |
| 356 if (!chrome::ShouldUseFullSizeContentView()) { |
| 357 rootView = [rootView superview]; |
| 358 } |
| 359 |
| 355 Class nsVisualEffectViewClass = NSClassFromString(@"NSVisualEffectView"); | 360 Class nsVisualEffectViewClass = NSClassFromString(@"NSVisualEffectView"); |
| 356 DCHECK(nsVisualEffectViewClass); | 361 DCHECK(nsVisualEffectViewClass); |
| 357 for (NSView* view in [rootView subviews]) { | 362 for (NSView* view in [rootView subviews]) { |
| 358 if ([view isKindOfClass:nsVisualEffectViewClass]) { | 363 if ([view isKindOfClass:nsVisualEffectViewClass]) { |
| 359 return base::mac::ObjCCast<NSVisualEffectView>(view); | 364 return base::mac::ObjCCast<NSVisualEffectView>(view); |
| 360 } | 365 } |
| 361 } | 366 } |
| 362 return nil; | 367 return nil; |
| 363 } | 368 } |
| 364 | 369 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 if (visualEffectsDisabledForFullscreen_ || | 422 if (visualEffectsDisabledForFullscreen_ || |
| 418 themeProvider->HasCustomImage(IDR_THEME_FRAME) || | 423 themeProvider->HasCustomImage(IDR_THEME_FRAME) || |
| 419 themeProvider->HasCustomColor(ThemeProperties::COLOR_FRAME)) { | 424 themeProvider->HasCustomColor(ThemeProperties::COLOR_FRAME)) { |
| 420 [visualEffectView setState:NSVisualEffectStateInactive]; | 425 [visualEffectView setState:NSVisualEffectStateInactive]; |
| 421 } else { | 426 } else { |
| 422 [visualEffectView setState:NSVisualEffectStateFollowsWindowActiveState]; | 427 [visualEffectView setState:NSVisualEffectStateFollowsWindowActiveState]; |
| 423 } | 428 } |
| 424 } | 429 } |
| 425 | 430 |
| 426 @end | 431 @end |
| OLD | NEW |