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

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

Issue 1987893002: Reland of [Mac][Material Design] Update bookmarks bar to Material Design. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_
6 #define CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ 6 #define CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 12 matching lines...) Expand all
23 enum { 23 enum {
24 kLeftButtonType = -1, 24 kLeftButtonType = -1,
25 kLeftButtonWithShadowType = -2, 25 kLeftButtonWithShadowType = -2,
26 kStandardButtonType = 0, 26 kStandardButtonType = 0,
27 kRightButtonType = 1, 27 kRightButtonType = 1,
28 kMiddleButtonType = 2, 28 kMiddleButtonType = 2,
29 // Draws like a standard button, except when clicked where the interior 29 // Draws like a standard button, except when clicked where the interior
30 // doesn't darken using the theme's "pressed" gradient. Instead uses the 30 // doesn't darken using the theme's "pressed" gradient. Instead uses the
31 // normal un-pressed gradient. 31 // normal un-pressed gradient.
32 kStandardButtonTypeWithLimitedClickFeedback = 3, 32 kStandardButtonTypeWithLimitedClickFeedback = 3,
33 kMaterialStandardButtonTypeWithLimitedClickFeedback = 4,
33 }; 34 };
34 typedef NSInteger ButtonType; 35 typedef NSInteger ButtonType;
35 36
36 namespace gradient_button_cell { 37 namespace gradient_button_cell {
37 38
38 // Pulsing state for this button. 39 // Pulsing state for this button.
39 typedef enum { 40 typedef enum {
40 // Stable states. 41 // Stable states.
41 kPulsedOn, 42 kPulsedOn,
42 kPulsedOff, 43 kPulsedOff,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 - (BOOL)isContinuousPulsing; 100 - (BOOL)isContinuousPulsing;
100 101
101 // Safely stop continuous pulsing by turning off all timers. 102 // Safely stop continuous pulsing by turning off all timers.
102 // May leave the cell in an odd state. 103 // May leave the cell in an odd state.
103 // Needed by an owning control's dealloc routine. 104 // Needed by an owning control's dealloc routine.
104 - (void)safelyStopPulsing; 105 - (void)safelyStopPulsing;
105 106
106 // Actually fetches current mouse position and does a hit test. 107 // Actually fetches current mouse position and does a hit test.
107 - (BOOL)isMouseReallyInside; 108 - (BOOL)isMouseReallyInside;
108 109
110 // Returns the offset of the start of the text in the cell.
111 - (CGFloat)textStartXOffset;
112
109 // Defines the top offset of text within the cell. Used by drawTitle and can 113 // Defines the top offset of text within the cell. Used by drawTitle and can
110 // be overriden by objects that inherit this class for placement of text. 114 // be overriden by objects that inherit this class for placement of text.
111 - (int)verticalTextOffset; 115 - (int)verticalTextOffset;
112 116
113 @property(assign, nonatomic) CGFloat hoverAlpha; 117 @property(assign, nonatomic) CGFloat hoverAlpha;
114 118
115 // An image that will be drawn after the normal content of the button cell, 119 // An image that will be drawn after the normal content of the button cell,
116 // overlaying it. Never themed. 120 // overlaying it. Never themed.
117 @property(retain, nonatomic) NSImage* overlayImage; 121 @property(retain, nonatomic) NSImage* overlayImage;
118 122
119 @end 123 @end
120 124
121 @interface GradientButtonCell(TestingAPI) 125 @interface GradientButtonCell(TestingAPI)
122 - (BOOL)isMouseInside; 126 - (BOOL)isMouseInside;
123 - (BOOL)pulsing; 127 - (BOOL)pulsing;
124 - (gradient_button_cell::PulseState)pulseState; 128 - (gradient_button_cell::PulseState)pulseState;
125 - (void)setPulseState:(gradient_button_cell::PulseState)pstate; 129 - (void)setPulseState:(gradient_button_cell::PulseState)pstate;
126 @end 130 @end
127 131
128 #endif // CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ 132 #endif // CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm ('k') | chrome/browser/ui/cocoa/gradient_button_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698