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

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

Issue 2868058: [Mac] Re-enable decoration tooltips in omnibox. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.mm
diff --git a/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.mm b/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.mm
index 1d5466aa74b11d973a5fb81515469dbb8c626f01..1f2b9acc85042b4e91484b915ea0d5f07455d79f 100644
--- a/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.mm
+++ b/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.mm
@@ -687,4 +687,19 @@ void CalculatePositionsInFrame(
return NSDragOperationCopy;
}
+- (void)updateToolTipsInRect:(NSRect)cellFrame
+ ofView:(AutocompleteTextField*)controlView {
+ std::vector<LocationBarDecoration*> decorations;
+ std::vector<NSRect> decorationFrames;
+ NSRect textFrame;
+ CalculatePositionsInFrame(cellFrame, leftDecorations_, rightDecorations_,
+ &decorations, &decorationFrames, &textFrame);
+
+ for (size_t i = 0; i < decorations.size(); ++i) {
+ NSString* tooltip = decorations[i]->GetToolTip();
+ if ([tooltip length] > 0)
+ [controlView addToolTip:tooltip forRect:decorationFrames[i]];
+ }
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698