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

Unified Diff: trunk/src/ui/base/cocoa/controls/hover_image_menu_button_cell.mm

Issue 17059002: Revert 206237 "Menu for the OSX app launcher, HoverImageMenuButt..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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
Index: trunk/src/ui/base/cocoa/controls/hover_image_menu_button_cell.mm
===================================================================
--- trunk/src/ui/base/cocoa/controls/hover_image_menu_button_cell.mm (revision 206373)
+++ trunk/src/ui/base/cocoa/controls/hover_image_menu_button_cell.mm (working copy)
@@ -1,69 +0,0 @@
-// Copyright 2013 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.
-
-#import "ui/base/cocoa/controls/hover_image_menu_button_cell.h"
-
-@implementation HoverImageMenuButtonCell
-
-@synthesize hovered = hovered_;
-
-- (id)initTextCell:(NSString*)stringValue
- pullsDown:(BOOL)pullDown {
- if ((self = [super initTextCell:stringValue
- pullsDown:pullDown])) {
- [self setUsesItemFromMenu:NO];
- }
- return self;
-}
-
-- (void)setHoverImage:(NSImage*)newImage {
- if ([hoverImage_ isEqual:newImage])
- return;
-
- hoverImage_.reset([newImage retain]);
- if (hovered_)
- [[self controlView] setNeedsDisplay:YES];
-}
-
-- (NSImage*)hoverImage {
- return hoverImage_;
-}
-
-- (void)setHovered:(BOOL)hovered {
- if (hovered_ == hovered)
- return;
-
- hovered_ = hovered;
- [[self controlView] setNeedsDisplay:YES];
-}
-
-- (NSImage*)imageToDraw {
- if ([self isHighlighted] && [self alternateImage])
- return [self alternateImage];
-
- if ([self isHovered] && [self hoverImage])
- return [self hoverImage];
-
- // Note that NSPopUpButtonCell updates the cell image when the [self menuItem]
- // changes.
- return [self image];
-}
-
-- (void)setImage:(NSImage*)defaultImage {
- scoped_nsobject<NSMenuItem> buttonMenuItem([[NSMenuItem alloc] init]);
- [buttonMenuItem setImage:defaultImage];
- [self setMenuItem:buttonMenuItem];
-}
-
-- (void)drawWithFrame:(NSRect)cellFrame
- inView:(NSView*)controlView {
- [[self imageToDraw] drawInRect:cellFrame
- fromRect:NSZeroRect
- operation:NSCompositeSourceOver
- fraction:1.0
- respectFlipped:YES
- hints:nil];
-}
-
-@end

Powered by Google App Engine
This is Rietveld 408576698