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

Side by Side Diff: chrome/browser/ui/cocoa/hover_button.h

Issue 12937008: Move HoverButton and HoverImageButton from chrome/browser/ui/cocoa/ to ui/base/cocoa. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 7 years, 9 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 (c) 2011 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 #ifndef CHROME_BROWSER_UI_COCOA_HOVER_BUTTON_
6 #define CHROME_BROWSER_UI_COCOA_HOVER_BUTTON_
7
8 #import <Cocoa/Cocoa.h>
9
10 #include "base/memory/scoped_nsobject.h"
11 #import "ui/base/cocoa/tracking_area.h"
12
13 // A button that changes when you hover over it and click it.
14 @interface HoverButton : NSButton {
15 @protected
16 // Enumeration of the hover states that the close button can be in at any one
17 // time. The button cannot be in more than one hover state at a time.
18 enum HoverState {
19 kHoverStateNone = 0,
20 kHoverStateMouseOver = 1,
21 kHoverStateMouseDown = 2
22 };
23
24 HoverState hoverState_;
25
26 @private
27 // Tracking area for button mouseover states.
28 ui::ScopedCrTrackingArea trackingArea_;
29 }
30
31 @property(nonatomic) HoverState hoverState;
32
33 // Enables or disables the tracking for the button.
34 - (void)setTrackingEnabled:(BOOL)enabled;
35
36 // Checks to see whether the mouse is in the button's bounds and update
37 // the image in case it gets out of sync. This occurs to the close button
38 // when you close a tab so the tab to the left of it takes its place, and
39 // drag the button without moving the mouse before you press the button down.
40 - (void)checkImageState;
41
42 @end
43
44 #endif // CHROME_BROWSER_UI_COCOA_HOVER_BUTTON_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/download/download_shelf_controller.mm ('k') | chrome/browser/ui/cocoa/hover_button.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698