Commit cd3581a9 authored by miu@chromium.org's avatar miu@chromium.org

[Cocoa] Clean-up: Update comments regarding drawRect override in TabContentsContainerView.

Once upon a time, in an era of great suffering, Chromium Mac was not
using CoreAnimation, with it being necessary to override -drawRect: to
paint the tab contents area background fill.  That time has, unfortunately,
not yet passed.

This change simply updates a few comments to wrap up the resolution
of bug 354598, which ccameron@ has mainly fixed in an earlier
change; and also defaults the bgColor to white when the themed color
is not available.

BUG=354598

Review URL: https://codereview.chromium.org/319703006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275567 0039d316-1c4b-4281-b951-d872f2087c98
parent 2cd9313e
......@@ -88,6 +88,8 @@ class FullscreenObserver : public WebContentsObserver {
delegate_ = delegate;
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableCoreAnimation)) {
// TODO(ccameron): Remove the -drawRect: method once the
// kDisableCoreAnimation switch is removed.
ScopedCAActionDisabler disabler;
base::scoped_nsobject<CALayer> layer([[CALayer alloc] init]);
[layer setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
......@@ -118,7 +120,7 @@ class FullscreenObserver : public WebContentsObserver {
if (theme)
bgColor = theme->GetNSColor(ThemeProperties::COLOR_NTP_BACKGROUND);
if (!bgColor)
bgColor = [[self window] backgroundColor];
bgColor = [NSColor whiteColor];
const float kDarknessFraction = 0.80f;
return [bgColor blendedColorWithFraction:kDarknessFraction
ofColor:[NSColor blackColor]];
......@@ -126,6 +128,8 @@ class FullscreenObserver : public WebContentsObserver {
// Override -drawRect to fill the view with a solid color outside of the
// subview's frame.
//
// Note: This method is never called when CoreAnimation is enabled.
- (void)drawRect:(NSRect)dirtyRect {
NSView* const contentsView =
[[self subviews] count] > 0 ? [[self subviews] objectAtIndex:0] : nil;
......@@ -233,8 +237,6 @@ class FullscreenObserver : public WebContentsObserver {
[contentsNativeView setAutoresizingMask:NSViewWidthSizable|
NSViewHeightSizable];
// TODO(miu): The following can be removed once we use a CALayer in
// TabContentsContainerView. http://crbug.com/354598
[contentsContainer setNeedsDisplay:YES];
// The rendering path with overlapping views disabled causes bugs when
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment