BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / constrained_window / constrained_window_button.h
blob8026b30555031f7338c18f4ef16231b137e44dfe
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_BUTTON_
6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_BUTTON_
8 #import <Cocoa/Cocoa.h>
10 #import "ui/base/cocoa/tracking_area.h"
12 namespace constrained_window_button {
13 const CGFloat kButtonMinWidth = 72;
16 @protocol ConstrainedWindowButtonDrawableCell
17 @property (nonatomic, assign) BOOL isMouseInside;
18 - (BOOL)isEnabled;
19 - (BOOL)isHighlighted;
20 @end
22 // A push button for use in a constrained window. Specialized constrained
23 // windows that need a push button should use this class instead of NSButton.
24 @interface ConstrainedWindowButton : NSButton {
25 @private
26 ui::ScopedCrTrackingArea trackingArea_;
29 extern const CGFloat buttonMinWidth_;
31 // Draws the background and shadow inside |path| with the appropriate
32 // colors for |buttonState|, onto |view|.
33 + (void)DrawBackgroundAndShadowForPath:(NSBezierPath*)path
34 withCell:(id<ConstrainedWindowButtonDrawableCell>)cell
35 inView:(NSView*)view;
37 // Draws the highlight inside |path|, with the color for |buttonState|,
38 // onto |view|.
39 + (void)DrawInnerHighlightForPath:(NSBezierPath*)path
40 withCell:(id<ConstrainedWindowButtonDrawableCell>)cell
41 inView:(NSView*)view;
43 // Draws the border along |path|, with a color according to |buttonState|,
44 // onto |view|.
45 + (void)DrawBorderForPath:(NSBezierPath*)path
46 withCell:(id<ConstrainedWindowButtonDrawableCell>)cell
47 inView:(NSView*)view;
48 @end
50 // A button cell used by ConstrainedWindowButton.
51 @interface ConstrainedWindowButtonCell :
52 NSButtonCell<ConstrainedWindowButtonDrawableCell> {
53 @private
54 BOOL isMouseInside_;
57 @end
59 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_BUTTON_