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_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "base/mac/sdk_forward_declarations.h" | 8 #import "base/mac/sdk_forward_declarations.h" |
9 #import "chrome/browser/ui/cocoa/browser_window_layout.h" | 9 #import "chrome/browser/ui/cocoa/browser_window_layout.h" |
10 #import "chrome/browser/ui/cocoa/fast_resize_view.h" | 10 #import "chrome/browser/ui/cocoa/fast_resize_view.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } | 352 } |
353 | 353 |
354 - (void)insertTabStripBackgroundViewIntoWindow:(NSWindow*)window | 354 - (void)insertTabStripBackgroundViewIntoWindow:(NSWindow*)window |
355 titleBar:(BOOL)hasTitleBar { | 355 titleBar:(BOOL)hasTitleBar { |
356 DCHECK(tabStripBackgroundView_); | 356 DCHECK(tabStripBackgroundView_); |
357 NSView* rootView = [[window contentView] superview]; | 357 NSView* rootView = [[window contentView] superview]; |
358 | 358 |
359 // In Material Design on 10.10 and higher, the top portion of the window is | 359 // In Material Design on 10.10 and higher, the top portion of the window is |
360 // blurred using an NSVisualEffectView. | 360 // blurred using an NSVisualEffectView. |
361 Class nsVisualEffectViewClass = NSClassFromString(@"NSVisualEffectView"); | 361 Class nsVisualEffectViewClass = NSClassFromString(@"NSVisualEffectView"); |
362 if (!ui::MaterialDesignController::IsModeMaterial() || | 362 if (!nsVisualEffectViewClass) { |
363 !nsVisualEffectViewClass) { | |
364 [rootView addSubview:tabStripBackgroundView_ | 363 [rootView addSubview:tabStripBackgroundView_ |
365 positioned:NSWindowBelow | 364 positioned:NSWindowBelow |
366 relativeTo:nil]; | 365 relativeTo:nil]; |
367 return; | 366 return; |
368 } | 367 } |
369 | 368 |
370 [window setTitlebarAppearsTransparent:YES]; | 369 [window setTitlebarAppearsTransparent:YES]; |
371 | 370 |
372 // If the window has a normal titlebar, then do not add NSVisualEffectView. | 371 // If the window has a normal titlebar, then do not add NSVisualEffectView. |
373 if (hasTitleBar) | 372 if (hasTitleBar) |
(...skipping 30 matching lines...) Expand all Loading... |
404 [visualEffectView addSubview:tabStripBackgroundView_]; | 403 [visualEffectView addSubview:tabStripBackgroundView_]; |
405 } | 404 } |
406 | 405 |
407 // Called when the size of the window content area has changed. Override to | 406 // Called when the size of the window content area has changed. Override to |
408 // position specific views. Base class implementation does nothing. | 407 // position specific views. Base class implementation does nothing. |
409 - (void)layoutSubviews { | 408 - (void)layoutSubviews { |
410 NOTIMPLEMENTED(); | 409 NOTIMPLEMENTED(); |
411 } | 410 } |
412 | 411 |
413 @end | 412 @end |
OLD | NEW |