| Index: chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.h
|
| diff --git a/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.h b/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.h
|
| index 23b6305aafe5e23358a2b6ac3ccabc76d1875ca2..cbb3e635168da47d883d251790c043735d24b268 100644
|
| --- a/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.h
|
| +++ b/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.h
|
| @@ -2,49 +2,17 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include <vector>
|
| +
|
| #import <Cocoa/Cocoa.h>
|
|
|
| #import "chrome/browser/cocoa/styled_text_field_cell.h"
|
|
|
| #include "base/scoped_nsobject.h"
|
| -#include "chrome/browser/cocoa/location_bar/location_bar_view_mac.h"
|
|
|
| +@class AutocompleteTextField;
|
| class LocationBarDecoration;
|
|
|
| -// Holds a |LocationBarImageView| and its current rect. Do not keep references
|
| -// to this object, only use it directly after calling |-layedOutIcons:|.
|
| -// TODO(shess): This class is basically a helper for laying out the
|
| -// icons. Try to refactor it away. If that is not reasonable, at
|
| -// least split the image and label cases into subclasses once the
|
| -// Omnibox stuff is settled.
|
| -@interface AutocompleteTextFieldIcon : NSObject {
|
| - // YES to draw the label part of |view_|, otherwise draw the image
|
| - // part.
|
| - BOOL isLabel_;
|
| -
|
| - // The frame rect of |view_|.
|
| - NSRect rect_;
|
| -
|
| - // weak, owned by LocationBarViewMac.
|
| - LocationBarViewMac::LocationBarImageView* view_;
|
| -}
|
| -
|
| -@property(assign, nonatomic) NSRect rect;
|
| -@property(assign, nonatomic) LocationBarViewMac::LocationBarImageView* view;
|
| -
|
| -- (id)initImageWithView:(LocationBarViewMac::LocationBarImageView*)view;
|
| -- (id)initLabelWithView:(LocationBarViewMac::LocationBarImageView*)view;
|
| -
|
| -// Position |view_| right-justified in |frame|.
|
| -- (void)positionInFrame:(NSRect)frame;
|
| -
|
| -// Draw image or label of |view_| in |rect_| within |controlView|.
|
| -// Only call after |-positionInFrame:| has set |rect_| (or after an
|
| -// explicit |-setRect:|).
|
| -- (void)drawInView:(NSView*)controlView;
|
| -
|
| -@end
|
| -
|
| // AutocompleteTextFieldCell extends StyledTextFieldCell to provide support for
|
| // certain decorations to be applied to the field. These are the search hint
|
| // ("Type to search" on the right-hand side), the keyword hint ("Press [Tab] to
|
| @@ -60,9 +28,6 @@ class LocationBarDecoration;
|
| // Set if there is a string to display as a hint on the right-hand
|
| // side of the field. Exclusive WRT |keywordString_|;
|
| scoped_nsobject<NSAttributedString> hintString_;
|
| -
|
| - // List of content blocked icons. This may be NULL during testing.
|
| - LocationBarViewMac::ContentSettingViews* content_setting_views_;
|
| }
|
|
|
| // Chooses |anImage| only if all pieces won't fit w/in |width|.
|
| @@ -92,24 +57,17 @@ class LocationBarDecoration;
|
| // The width available after accounting for decorations.
|
| - (CGFloat)availableWidthInFrame:(const NSRect)frame;
|
|
|
| -- (void)setContentSettingViewsList:
|
| - (LocationBarViewMac::ContentSettingViews*)views;
|
| -
|
| -// Returns an array of the visible AutocompleteTextFieldIcon objects. Returns
|
| -// only visible icons.
|
| -- (NSArray*)layedOutIcons:(NSRect)cellFrame;
|
| -
|
| // Return the frame for |aDecoration| if the cell is in |cellFrame|.
|
| // Returns |NSZeroRect| for decorations which are not currently
|
| // visible.
|
| - (NSRect)frameForDecoration:(const LocationBarDecoration*)aDecoration
|
| inFrame:(NSRect)cellFrame;
|
|
|
| -// Find the icon under the event. |nil| if |theEvent| is not over
|
| -// anything.
|
| -- (AutocompleteTextFieldIcon*)iconForEvent:(NSEvent*)theEvent
|
| - inRect:(NSRect)cellFrame
|
| - ofView:(AutocompleteTextField*)controlView;
|
| +// Find the decoration under the event. |NULL| if |theEvent| is not
|
| +// over anything.
|
| +- (LocationBarDecoration*)decorationForEvent:(NSEvent*)theEvent
|
| + inRect:(NSRect)cellFrame
|
| + ofView:(AutocompleteTextField*)field;
|
|
|
| // Return the appropriate menu for any decorations under event.
|
| // Returns nil if no menu is present for the decoration, or if the
|
|
|