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

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: fix comment 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 #include "base/mac/foundation_util.h"
8 #import "ui/base/cocoa/controls/hover_image_menu_button_cell.h"
9
10 @implementation HoverImageMenuButton
11
12 + (Class)cellClass {
13 return [HoverImageMenuButtonCell class];
14 }
15
16 - (id)initWithFrame:(NSRect)frameRect
17 pullsDown:(BOOL)flag {
18 if ((self = [super initWithFrame:frameRect
19 pullsDown:flag])) {
20 trackingArea_.reset(
21 [[CrTrackingArea alloc] initWithRect:NSZeroRect
22 options:NSTrackingInVisibleRect |
23 NSTrackingMouseEnteredAndExited |
24 NSTrackingActiveInKeyWindow
25 owner:self
26 userInfo:nil]);
27 [self addTrackingArea:trackingArea_.get()];
28 }
29 return self;
30 }
31
32 - (HoverImageMenuButtonCell*)hoverImageMenuButtonCell {
33 return base::mac::ObjCCastStrict<HoverImageMenuButtonCell>([self cell]);
34 }
35
36 - (void)mouseEntered:(NSEvent*)theEvent {
37 [[self cell] setHovered:YES];
38 }
39
40 - (void)mouseExited:(NSEvent*)theEvent {
41 [[self cell] setHovered:NO];
42 }
43
44 @end
OLDNEW
« no previous file with comments | « ui/base/cocoa/controls/hover_image_menu_button.h ('k') | ui/base/cocoa/controls/hover_image_menu_button_cell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698