Index: chrome/browser/cocoa/autocomplete_text_field_cell.mm |
diff --git a/chrome/browser/cocoa/autocomplete_text_field_cell.mm b/chrome/browser/cocoa/autocomplete_text_field_cell.mm |
index 7c0c27f012ffa769ab585926e2629eb25a109091..699a59ba0f236577e1c517ce0c908a7430855f65 100644 |
--- a/chrome/browser/cocoa/autocomplete_text_field_cell.mm |
+++ b/chrome/browser/cocoa/autocomplete_text_field_cell.mm |
@@ -272,6 +272,10 @@ void DrawImageInRect(NSImage* image, NSView* view, const NSRect& rect) { |
locationIconView_ = view; |
} |
+- (void)setStarIconView:(LocationBarViewMac::LocationBarImageView*)view { |
+ starIconView_ = view; |
+} |
+ |
- (void)setSecurityLabelView:(LocationBarViewMac::LocationBarImageView*)view { |
securityLabelView_ = view; |
} |
@@ -340,6 +344,18 @@ void DrawImageInRect(NSImage* image, NSView* view, const NSRect& rect) { |
imageSize.width, imageSize.height); |
} |
+- (NSRect)starIconFrameForFrame:(NSRect)cellFrame { |
+ if (!starIconView_ || !starIconView_->IsVisible()) |
+ return NSZeroRect; |
+ |
+ // The star icon is always at the RHS. |
+ scoped_nsobject<AutocompleteTextFieldIcon> icon( |
+ [[AutocompleteTextFieldIcon alloc] initImageWithView:starIconView_]); |
+ cellFrame.size.width -= kHintXOffset; |
+ [icon positionInFrame:cellFrame]; |
+ return [icon rect]; |
+} |
+ |
- (size_t)pageActionCount { |
// page_action_views_ may be NULL during testing, or if the |
// containing LocationViewMac object has already been destructed |
@@ -471,6 +487,10 @@ void DrawImageInRect(NSImage* image, NSView* view, const NSRect& rect) { |
views.push_back(page_action_views_->ViewAt(i)); |
} |
+ // The star icon should always come last. |
+ if (starIconView_) |
+ views.push_back(starIconView_); |
+ |
// Load the visible views into |result|. |
for (std::vector<LocationBarViewMac::LocationBarImageView*>::const_iterator |
iter = views.begin(); iter != views.end(); ++iter) { |