summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/cocoa/gradient_button_cell.h7
-rw-r--r--chrome/browser/cocoa/gradient_button_cell.mm31
2 files changed, 2 insertions, 36 deletions
diff --git a/chrome/browser/cocoa/gradient_button_cell.h b/chrome/browser/cocoa/gradient_button_cell.h
index fc79c09..a485f63 100644
--- a/chrome/browser/cocoa/gradient_button_cell.h
+++ b/chrome/browser/cocoa/gradient_button_cell.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -37,7 +37,6 @@ typedef NSInteger ButtonType;
CGFloat hoverAlpha_; // 0-1. Controls the alpha during mouse hover
NSTimeInterval lastHoverUpdate_;
scoped_nsobject<NSGradient> gradient_;
- scoped_nsobject<NSImage> underlayImage_;
}
// Turn off theming. Temporary work-around.
@@ -53,10 +52,6 @@ typedef NSInteger ButtonType;
cellFrame:(NSRect)cellFrame
defaultGradient:(NSGradient*)defaultGradient;
-// An image to underlay beneath the existing image; not themed. May be nil.
-- (NSImage*)underlayImage;
-- (void)setUnderlayImage:(NSImage*)image;
-
// Let the view know when the mouse moves in and out. A timer will update
// the current hoverAlpha_ based on these events.
- (void)setMouseInside:(BOOL)flag animate:(BOOL)animate;
diff --git a/chrome/browser/cocoa/gradient_button_cell.mm b/chrome/browser/cocoa/gradient_button_cell.mm
index ac71474..15110e8 100644
--- a/chrome/browser/cocoa/gradient_button_cell.mm
+++ b/chrome/browser/cocoa/gradient_button_cell.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,8 +14,6 @@
@interface GradientButtonCell (Private)
- (void)sharedInit;
-- (void)drawUnderlayImageWithFrame:(NSRect)cellFrame
- inView:(NSView*)controlView;
// Get drawing parameters for a given cell frame in a given view. The inner
// frame is the one required by |-drawInteriorWithFrame:inView:|. The inner and
@@ -122,16 +120,6 @@ static const NSTimeInterval kAnimationHideDuration = 0.4;
shouldTheme_ = shouldTheme;
}
-- (NSImage*)underlayImage {
- return underlayImage_;
-}
-
-- (void)setUnderlayImage:(NSImage*)image {
- underlayImage_.reset([image retain]);
-
- [[self controlView] setNeedsDisplay:YES];
-}
-
- (NSBackgroundStyle)interiorBackgroundStyle {
// Never lower the interior, since that just leads to a weird shadow which can
// often interact badly with the theme.
@@ -410,8 +398,6 @@ static const NSTimeInterval kAnimationHideDuration = 0.4;
[shadow set];
}
- [self drawUnderlayImageWithFrame:cellFrame inView:controlView];
-
CGContextBeginTransparencyLayer(context, 0);
NSRect imageRect = NSZeroRect;
imageRect.size = [[self image] size];
@@ -431,8 +417,6 @@ static const NSTimeInterval kAnimationHideDuration = 0.4;
CGContextEndTransparencyLayer(context);
[NSGraphicsContext restoreGraphicsState];
} else {
- [self drawUnderlayImageWithFrame:cellFrame inView:controlView];
-
// NSCell draws these uncentered for some reason, probably because of the
// of control in the xib
[super drawInteriorWithFrame:NSOffsetRect(cellFrame, 0, 1)
@@ -440,19 +424,6 @@ static const NSTimeInterval kAnimationHideDuration = 0.4;
}
}
-- (void)drawUnderlayImageWithFrame:(NSRect)cellFrame
- inView:(NSView*)controlView {
- if (underlayImage_) {
- NSRect imageRect = NSZeroRect;
- imageRect.size = [underlayImage_ size];
- [underlayImage_ setFlipped:[controlView isFlipped]];
- [underlayImage_ drawInRect:[self imageRectForBounds:cellFrame]
- fromRect:imageRect
- operation:NSCompositeSourceOver
- fraction:[self isEnabled] ? 1.0 : 0.5];
- }
-}
-
- (NSBezierPath*)clipPathForFrame:(NSRect)cellFrame
inView:(NSView*)controlView {
NSBezierPath* boundingPath = nil;