| 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 "ui/base/cocoa/underlay_opengl_hosting_window.h" | 5 #import "ui/base/cocoa/underlay_opengl_hosting_window.h" |
| 6 | 6 |
| 7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // on the right and left edge of the window. | 26 // on the right and left edge of the window. |
| 27 - (void)_setContentHasShadow:(BOOL)shadow; | 27 - (void)_setContentHasShadow:(BOOL)shadow; |
| 28 @end | 28 @end |
| 29 | 29 |
| 30 @interface OpaqueView : NSView | 30 @interface OpaqueView : NSView |
| 31 @end | 31 @end |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 bool CoreAnimationIsEnabled() { | 35 bool CoreAnimationIsEnabled() { |
| 36 static bool is_enabled = !CommandLine::ForCurrentProcess()->HasSwitch( | 36 static bool is_enabled = CommandLine::ForCurrentProcess()->HasSwitch( |
| 37 switches::kDisableCoreAnimation); | 37 switches::kEnableCoreAnimation); |
| 38 return is_enabled; | 38 return is_enabled; |
| 39 } | 39 } |
| 40 | 40 |
| 41 NSComparisonResult OpaqueViewsOnTop(id view1, id view2, void* context) { | 41 NSComparisonResult OpaqueViewsOnTop(id view1, id view2, void* context) { |
| 42 BOOL view_1_is_opaque_view = [view1 isKindOfClass:[OpaqueView class]]; | 42 BOOL view_1_is_opaque_view = [view1 isKindOfClass:[OpaqueView class]]; |
| 43 BOOL view_2_is_opaque_view = [view2 isKindOfClass:[OpaqueView class]]; | 43 BOOL view_2_is_opaque_view = [view2 isKindOfClass:[OpaqueView class]]; |
| 44 if (view_1_is_opaque_view && view_2_is_opaque_view) | 44 if (view_1_is_opaque_view && view_2_is_opaque_view) |
| 45 return NSOrderedSame; | 45 return NSOrderedSame; |
| 46 if (view_1_is_opaque_view) | 46 if (view_1_is_opaque_view) |
| 47 return NSOrderedDescending; | 47 return NSOrderedDescending; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 NSViewHeightSizable]; | 156 NSViewHeightSizable]; |
| 157 [rightOpaque setAlphaValue:kAlphaValueJustOpaqueEnough]; | 157 [rightOpaque setAlphaValue:kAlphaValueJustOpaqueEnough]; |
| 158 [rootView addSubview:rightOpaque]; | 158 [rootView addSubview:rightOpaque]; |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 return self; | 162 return self; |
| 163 } | 163 } |
| 164 | 164 |
| 165 @end | 165 @end |
| OLD | NEW |