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

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

Issue 15553008: Instant Extended: Reduce clipping in omnibox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_STYLED_TEXT_FIELD_CELL_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_STYLED_TEXT_FIELD_CELL_H_
6 #define CHROME_BROWSER_UI_COCOA_STYLED_TEXT_FIELD_CELL_H_ 6 #define CHROME_BROWSER_UI_COCOA_STYLED_TEXT_FIELD_CELL_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #import "chrome/browser/ui/cocoa/rect_path_utils.h" 10 #import "chrome/browser/ui/cocoa/rect_path_utils.h"
11 11
12 // StyledTextFieldCell customizes the look of the standard Cocoa text field. 12 // StyledTextFieldCell customizes the look of the standard Cocoa text field.
13 // The border and focus ring are modified, as is the font baseline. Subclasses 13 // The border and focus ring are modified, as is the drawing rect. Subclasses
14 // can override |drawInteriorWithFrame:inView:| to provide custom drawing for 14 // can override |drawInteriorWithFrame:inView:| to provide custom drawing for
15 // decorations, but they must make sure to call the superclass' implementation 15 // decorations, but they must make sure to call the superclass' implementation
16 // with a modified frame after performing any custom drawing. 16 // with a modified frame after performing any custom drawing.
17 17
18 @interface StyledTextFieldCell : NSTextFieldCell { 18 @interface StyledTextFieldCell : NSTextFieldCell {
19 } 19 }
20 20
21 @end 21 @end
22 22
23 // Methods intended to be overridden by subclasses, not part of the public API 23 // Methods intended to be overridden by subclasses, not part of the public API
24 // and should not be called outside of subclasses. 24 // and should not be called outside of subclasses.
25 @interface StyledTextFieldCell (ProtectedMethods) 25 @interface StyledTextFieldCell (ProtectedMethods)
26 26
27 // Return the portion of the cell to show the text cursor over. The default 27 // Return the portion of the cell to show the text cursor over. The default
28 // implementation returns the full |cellFrame|. Subclasses should override this 28 // implementation returns the full |cellFrame|. Subclasses should override this
29 // method if they add any decorations. 29 // method if they add any decorations.
30 - (NSRect)textCursorFrameForFrame:(NSRect)cellFrame; 30 - (NSRect)textCursorFrameForFrame:(NSRect)cellFrame;
31 31
32 // Return the portion of the cell to use for text display. This corresponds to 32 // Return the portion of the cell to use for text display. This corresponds to
33 // the frame with our added decorations sliced off. The default implementation 33 // the frame with our added decorations sliced off. The default implementation
34 // returns the full |cellFrame|, as by default there are no decorations. 34 // returns the full |cellFrame|, as by default there are no decorations.
35 // Subclasses should override this method if they add any decorations. 35 // Subclasses should override this method if they add any decorations.
36 - (NSRect)textFrameForFrame:(NSRect)cellFrame; 36 - (NSRect)textFrameForFrame:(NSRect)cellFrame;
37 37
38 // Baseline adjust for the text in this cell. Defaults to 0. Subclasses should 38 // Offset from the top of the cell frame to the text frame. Defaults to 0.
39 // override as needed. 39 // Subclasses should
40 - (CGFloat)baselineAdjust; 40 - (CGFloat)topTextFrameOffset;
41
42 // Offset from the bottom of the cell frame to the text frame. Defaults to 0.
43 // Subclasses should
44 - (CGFloat)bottomTextFrameOffset;
41 45
42 // Radius of the corners of the field. Defaults to square corners (0.0). 46 // Radius of the corners of the field. Defaults to square corners (0.0).
43 - (CGFloat)cornerRadius; 47 - (CGFloat)cornerRadius;
44 48
45 // Which corners of the field to round. Defaults to RoundedAll. 49 // Which corners of the field to round. Defaults to RoundedAll.
46 - (rect_path_utils::RoundedCornerFlags)roundedFlags; 50 - (rect_path_utils::RoundedCornerFlags)roundedFlags;
47 51
48 // Returns YES if a light themed bezel should be drawn under the text field. 52 // Returns YES if a light themed bezel should be drawn under the text field.
49 // Default implementation returns NO. 53 // Default implementation returns NO.
50 - (BOOL)shouldDrawBezel; 54 - (BOOL)shouldDrawBezel;
51 55
52 @end 56 @end
53 57
54 #endif // CHROME_BROWSER_UI_COCOA_STYLED_TEXT_FIELD_CELL_H_ 58 #endif // CHROME_BROWSER_UI_COCOA_STYLED_TEXT_FIELD_CELL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm ('k') | chrome/browser/ui/cocoa/styled_text_field_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698