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

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: Use scoped object 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..f4ea8d380b6d794b0f556f4fe3ba0a594f532af4 100644
--- a/chrome/browser/ui/cocoa/fast_resize_view.mm
+++ b/chrome/browser/ui/cocoa/fast_resize_view.mm
@@ -2,10 +2,15 @@
// 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 "base/mac/scoped_nsobject.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 +21,24 @@
@implementation FastResizeView
+- (id)initWithFrame:(NSRect)frameRect {
+ if ((self = [super initWithFrame:frameRect])) {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableCoreAnimation)) {
+ ScopedCAActionDisabler disabler;
+ base::scoped_nsobject<CALayer> layer([[CALayer alloc] init]);
+ [layer setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
+ [self setLayer:layer];
+ [self setWantsLayer:YES];
+ }
+ }
+ 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