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

Unified Diff: chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm

Issue 319703006: [Cocoa] Clean-up: Update comments regarding drawRect override in TabContentsContainerView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Core Animation can still be disabled. :( Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm
diff --git a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm
index 31ed285b3952c22442d71df14d6faab25ef79e33..3a44e79fac722904498a87ff70e2ff317595d07d 100644
--- a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm
+++ b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm
@@ -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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698