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

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

Issue 2972593002: Mac: Fix up location bar decoration bubble anchoring. (Closed)
Patch Set: Created 3 years, 5 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 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_AUTOCOMPLETE_TEXT_FIELD_CELL_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_AUTOCOMPLETE_TEXT_FIELD_CELL_H_
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_AUTOCOMPLETE_TEXT_FIELD_CELL_H_ 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_AUTOCOMPLETE_TEXT_FIELD_CELL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #import <Cocoa/Cocoa.h> 10 #import <Cocoa/Cocoa.h>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 - (void)addTrailingDecoration:(LocationBarDecoration*)decoration; 68 - (void)addTrailingDecoration:(LocationBarDecoration*)decoration;
69 69
70 // The width available after accounting for decorations. 70 // The width available after accounting for decorations.
71 - (CGFloat)availableWidthInFrame:(const NSRect)frame; 71 - (CGFloat)availableWidthInFrame:(const NSRect)frame;
72 72
73 // Return the frame for |aDecoration| if the cell is in |cellFrame|. 73 // Return the frame for |aDecoration| if the cell is in |cellFrame|.
74 // Returns |NSZeroRect| for decorations which are not currently visible. 74 // Returns |NSZeroRect| for decorations which are not currently visible.
75 - (NSRect)frameForDecoration:(const LocationBarDecoration*)aDecoration 75 - (NSRect)frameForDecoration:(const LocationBarDecoration*)aDecoration
76 inFrame:(NSRect)cellFrame; 76 inFrame:(NSRect)cellFrame;
77 77
78 // Returns the frame representing the background of |decoration|. Also sets 78 // Returns whether |decoration| appears on the left or the right side of the
79 // |isLeftDecoration| according to whether the decoration appears on the left or 79 // text field.
80 // the right side of the text field. 80 - (BOOL)isLeftDecoration:(LocationBarDecoration*)decoration;
81 - (NSRect)backgroundFrameForDecoration:(LocationBarDecoration*)decoration
82 inFrame:(NSRect)cellFrame
83 isLeftDecoration:(BOOL*)isLeftDecoration;
84 81
85 // Returns true if it's okay to drop dragged data into the view at the 82 // Returns true if it's okay to drop dragged data into the view at the
86 // given location. 83 // given location.
87 - (BOOL)canDropAtLocationInWindow:(NSPoint)location 84 - (BOOL)canDropAtLocationInWindow:(NSPoint)location
88 ofView:(AutocompleteTextField*)controlView; 85 ofView:(AutocompleteTextField*)controlView;
89 86
90 // Find the decoration under the location in the window. Return |NULL| if 87 // Find the decoration under the location in the window. Return |NULL| if
91 // there's nothing in the location. 88 // there's nothing in the location.
92 - (LocationBarDecoration*)decorationForLocationInWindow:(NSPoint)location 89 - (LocationBarDecoration*)decorationForLocationInWindow:(NSPoint)location
93 inRect:(NSRect)cellFrame 90 inRect:(NSRect)cellFrame
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 147
151 // Methods which are either only for testing, or only public for testing. 148 // Methods which are either only for testing, or only public for testing.
152 @interface AutocompleteTextFieldCell (TestingAPI) 149 @interface AutocompleteTextFieldCell (TestingAPI)
153 150
154 // Returns |mouseTrackingDecorations_|. 151 // Returns |mouseTrackingDecorations_|.
155 - (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations; 152 - (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations;
156 153
157 @end 154 @end
158 155
159 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_AUTOCOMPLETE_TEXT_FIELD_CELL_H_ 156 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_AUTOCOMPLETE_TEXT_FIELD_CELL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698