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

Side by Side Diff: ui/base/cocoa/controls/hover_image_menu_button.mm

Issue 15955003: Menu for the OSX app launcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor HoverImageMenuButton into /ui/base/cocoa/controls 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ui/base/cocoa/controls/hover_image_menu_button.h"
6
7 @implementation HoverImageMenuButton
8
9 + (Class)cellClass {
10 return [HoverImageMenuButtonCell class];
11 }
12
13 - (id)initWithFrame:(NSRect)frameRect
14 pullsDown:(BOOL)flag {
15 if ((self = [super initWithFrame:frameRect
16 pullsDown:flag])) {
17 trackingArea_.reset(
18 [[CrTrackingArea alloc] initWithRect:NSZeroRect
19 options:NSTrackingInVisibleRect |
20 NSTrackingMouseEnteredAndExited |
21 NSTrackingActiveInKeyWindow
22 owner:self
23 userInfo:nil]);
24 [self addTrackingArea:trackingArea_.get()];
25
26 // Item 0 is the button label, which is not used.
27 [[self menu] addItemWithTitle:[NSString string]
tapted 2013/06/03 12:49:18 note: I've removed this from HoverImageMenuButton.
28 action:NULL
29 keyEquivalent:[NSString string]];
30 }
31 return self;
32 }
33
34 - (void)mouseEntered:(NSEvent*)theEvent {
35 [[self cell] setHovered:YES];
36 [self setNeedsDisplay:YES];
37 }
38
39 - (void)mouseExited:(NSEvent*)theEvent {
40 [[self cell] setHovered:NO];
41 [self setNeedsDisplay:YES];
42 }
43
44 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698