Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8687)

Unified Diff: chrome/browser/ui/cocoa/fast_resize_view.mm

Issue 184433005: Give the browser window's content view a CALayers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded include Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/cocoa/presentation_mode_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698