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

Unified Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm

Issue 2839893003: cocoa: allow omnibox decorations to become key (Closed)
Patch Set: fix nits Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
index fade6898f5157e459a726971b385b76c09c53089..e09ee0d517737e9da1027f40134298b071d15dad 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
@@ -736,6 +736,13 @@ - (void)handleFocusEvent:(NSEvent*)event
}
}
+- (int)leadingDecorationIndex:(LocationBarDecoration*)decoration {
+ for (size_t i = 0; i < leadingDecorations_.size(); ++i)
+ if (leadingDecorations_[i] == decoration)
+ return leadingDecorations_.size() - (i + 1);
+ return -1;
+}
+
@end
@implementation AutocompleteTextFieldCell (TestingAPI)

Powered by Google App Engine
This is Rietveld 408576698