Chromium Code Reviews| Index: chrome/browser/ui/cocoa/fast_resize_view.mm |
| diff --git a/chrome/browser/ui/cocoa/fast_resize_view.mm b/chrome/browser/ui/cocoa/fast_resize_view.mm |
| index 87f7787f287ecc9477ac018a8c3ad258f3f5aace..45fd3542e942bcf6924a5f370b7757f23c053dae 100644 |
| --- a/chrome/browser/ui/cocoa/fast_resize_view.mm |
| +++ b/chrome/browser/ui/cocoa/fast_resize_view.mm |
| @@ -2,10 +2,14 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#import <Cocoa/Cocoa.h> |
| #import "chrome/browser/ui/cocoa/fast_resize_view.h" |
| +#import <Cocoa/Cocoa.h> |
| + |
| #include "base/logging.h" |
| +#include "base/command_line.h" |
| +#include "ui/base/cocoa/animation_utils.h" |
| +#include "ui/base/ui_base_switches.h" |
| @interface FastResizeView (PrivateMethods) |
| // Lays out this views subviews. If fast resize mode is on, does not resize any |
| @@ -16,6 +20,25 @@ |
| @implementation FastResizeView |
| +- (id)initWithFrame:(NSRect)frameRect { |
| + if ((self = [super initWithFrame:frameRect])) { |
| + if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kDisableCoreAnimation)) { |
| + ScopedCAActionDisabler disabler; |
| + CALayer* layer = [[CALayer alloc] init]; |
|
Avi (use Gerrit)
2014/03/05 16:17:02
scoped_nsobject
ccameron
2014/03/05 18:18:40
Done.
|
| + [layer setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)]; |
| + [self setLayer:layer]; |
| + [self setWantsLayer:YES]; |
| + [layer release]; |
| + } |
| + } |
| + return self; |
| +} |
| + |
| +- (BOOL)isOpaque { |
| + return YES; |
| +} |
| + |
| - (void)setFastResizeMode:(BOOL)fastResizeMode { |
| if (fastResizeMode_ == fastResizeMode) |
| return; |