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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm

Issue 1099403005: [AiS] changing mac omnibox suggestions form NSMatrix to NSTableView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review changes Created 5 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/omnibox/omnibox_popup_cell.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
index df7b00d3bc6b1c315e1189e80962b1cd23eb322c..79fc749070a0ebae46aada0c05123fd34325ec33 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
@@ -23,6 +23,10 @@
namespace {
+// How much to adjust the cell sizing up from the default determined
+// by the font.
+const CGFloat kCellHeightAdjust = 6.0;
+
// How far to offset image column from the left.
const CGFloat kImageXOffset = 5.0;
@@ -205,6 +209,23 @@ NSAttributedString* CreateClassifiedAttributedString(
}
}
+- (id)copyWithZone:(NSZone*)zone {
+ OmniboxPopupCell* copy = [super copyWithZone:zone];
+ copy->match_ = match_;
+ copy->separator_.reset([separator_ copy]);
+ copy->description_.reset([description_ copy]);
+ copy->prefix_.reset([prefix_ copy]);
+ copy->maxMatchContentsWidth_ = maxMatchContentsWidth_;
+ copy->contentsOffset_ = contentsOffset_;
+ return copy;
+}
+
+- (NSRect)drawingRectForBounds:(NSRect)theRect {
+ // Enlarge the cell size.
shrike 2015/04/27 18:30:10 Do you mean decrease the cell size?
dschuyler 2015/05/01 21:50:53 Done.
+ theRect.size.height -= kCellHeightAdjust;
+ return theRect;
+}
+
- (void)setMaxMatchContentsWidth:(CGFloat)maxMatchContentsWidth {
maxMatchContentsWidth_ = maxMatchContentsWidth;
}

Powered by Google App Engine
This is Rietveld 408576698