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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h

Issue 2576563002: [Mac] Reverse the omnibox in RTL (Closed)
Patch Set: CL comments Created 3 years, 12 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <vector> 5 #include <vector>
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #import "chrome/browser/ui/cocoa/styled_text_field_cell.h" 10 #import "chrome/browser/ui/cocoa/styled_text_field_cell.h"
11 11
12 @class AutocompleteTextField; 12 @class AutocompleteTextField;
13 class LocationBarDecoration; 13 class LocationBarDecoration;
14 14
15 // AutocompleteTextFieldCell extends StyledTextFieldCell to provide support for 15 // AutocompleteTextFieldCell extends StyledTextFieldCell to provide support for
16 // certain decorations to be applied to the field. These are the search hint 16 // certain decorations to be applied to the field. These are the search hint
17 // ("Type to search" on the right-hand side), the keyword hint ("Press [Tab] to 17 // ("Type to search" on the right-hand side), the keyword hint ("Press [Tab] to
18 // search Engine" on the right-hand side), and keyword mode ("Search Engine:" in 18 // search Engine" on the right-hand side), and keyword mode ("Search Engine:" in
19 // a button-like token on the left-hand side). 19 // a button-like token on the left-hand side).
20 @interface AutocompleteTextFieldCell : StyledTextFieldCell { 20 @interface AutocompleteTextFieldCell : StyledTextFieldCell {
21 @private 21 @private
22 // Decorations which live to the left and right of the text, ordered 22 // Decorations which live before and after the text, ordered
23 // from outside in. Decorations are owned by |LocationBarViewMac|. 23 // from outside in. Decorations are owned by |LocationBarViewMac|.
24 std::vector<LocationBarDecoration*> leftDecorations_; 24 std::vector<LocationBarDecoration*> leadingDecorations_;
25 std::vector<LocationBarDecoration*> rightDecorations_; 25 std::vector<LocationBarDecoration*> trailingDecorations_;
26 26
27 // The decoration associated to the current dragging session. 27 // The decoration associated to the current dragging session.
28 LocationBarDecoration* draggedDecoration_; 28 LocationBarDecoration* draggedDecoration_;
29 29
30 // Decorations with tracking areas attached to the AutocompleteTextField. 30 // Decorations with tracking areas attached to the AutocompleteTextField.
31 std::vector<LocationBarDecoration*> mouseTrackingDecorations_; 31 std::vector<LocationBarDecoration*> mouseTrackingDecorations_;
32 32
33 // If YES then the text field will not draw a focus ring or show the insertion 33 // If YES then the text field will not draw a focus ring or show the insertion
34 // pointer. 34 // pointer.
35 BOOL hideFocusState_; 35 BOOL hideFocusState_;
(...skipping 13 matching lines...) Expand all
49 49
50 // Line height used for text in this cell. 50 // Line height used for text in this cell.
51 - (CGFloat)lineHeight; 51 - (CGFloat)lineHeight;
52 52
53 // Remove all of the tracking areas. 53 // Remove all of the tracking areas.
54 - (void)clearTrackingArea; 54 - (void)clearTrackingArea;
55 55
56 // Clear |leftDecorations_| and |rightDecorations_|. 56 // Clear |leftDecorations_| and |rightDecorations_|.
57 - (void)clearDecorations; 57 - (void)clearDecorations;
58 58
59 // Add a new left-side decoration to the right of the existing 59 // Add a new leading decoration after the existing
60 // left-side decorations. 60 // leading decorations.
61 - (void)addLeftDecoration:(LocationBarDecoration*)decoration; 61 - (void)addLeadingDecoration:(LocationBarDecoration*)decoration;
62 62
63 // Add a new right-side decoration to the left of the existing 63 // Add a new trailing decoration before the existing
64 // right-side decorations. 64 // trailing decorations.
65 - (void)addRightDecoration:(LocationBarDecoration*)decoration; 65 - (void)addTrailingDecoration:(LocationBarDecoration*)decoration;
66 66
67 // The width available after accounting for decorations. 67 // The width available after accounting for decorations.
68 - (CGFloat)availableWidthInFrame:(const NSRect)frame; 68 - (CGFloat)availableWidthInFrame:(const NSRect)frame;
69 69
70 // Return the frame for |aDecoration| if the cell is in |cellFrame|. 70 // Return the frame for |aDecoration| if the cell is in |cellFrame|.
71 // Returns |NSZeroRect| for decorations which are not currently visible. 71 // Returns |NSZeroRect| for decorations which are not currently visible.
72 - (NSRect)frameForDecoration:(const LocationBarDecoration*)aDecoration 72 - (NSRect)frameForDecoration:(const LocationBarDecoration*)aDecoration
73 inFrame:(NSRect)cellFrame; 73 inFrame:(NSRect)cellFrame;
74 74
75 // Returns the frame representing the background of |decoration|. Also sets 75 // Returns the frame representing the background of |decoration|. Also sets
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 ofView:(AutocompleteTextField*)controlView; 138 ofView:(AutocompleteTextField*)controlView;
139 @end 139 @end
140 140
141 // Methods which are either only for testing, or only public for testing. 141 // Methods which are either only for testing, or only public for testing.
142 @interface AutocompleteTextFieldCell (TestingAPI) 142 @interface AutocompleteTextFieldCell (TestingAPI)
143 143
144 // Returns |mouseTrackingDecorations_|. 144 // Returns |mouseTrackingDecorations_|.
145 - (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations; 145 - (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations;
146 146
147 @end 147 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698