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

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

Issue 98463012: Infinite Suggest for mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed reviewer comments Created 7 years 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 db647f8f6cf83e360090cc8347955909ec406ba6..04aceff9051f90c08cc337603b4e3de6f5042aef 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
@@ -28,6 +28,15 @@ NSColor* HoveredBackgroundColor() {
@implementation OmniboxPopupCell
+- (CGFloat)additionalOffset {
+ return additionalOffset_;
+}
Scott Hess - ex-Googler 2013/12/14 00:40:57 Is this method needed? -setAdditionalOffset: is n
Anuj 2013/12/16 02:53:19 Done.
+
+- (void)setAdditionalOffset:(CGFloat)additionalOffset {
+ additionalOffset_ = additionalOffset;
+}
+
+
- (id)init {
self = [super init];
if (self) {
@@ -41,6 +50,10 @@ NSColor* HoveredBackgroundColor() {
return self;
}
+- (CGFloat)textOffset {
+ return kTextXOffset + [self additionalOffset];
+}
+
// The default NSButtonCell drawing leaves the image flush left and
// the title next to the image. This spaces things out to line up
// with the star button and autocomplete field.
@@ -77,8 +90,9 @@ NSColor* HoveredBackgroundColor() {
NSAttributedString* title = [self attributedTitle];
if (title && [title length]) {
NSRect titleRect = cellFrame;
- titleRect.size.width -= kTextXOffset;
- titleRect.origin.x += kTextXOffset;
+ CGFloat textXOffset = [self textOffset];
+ titleRect.size.width -= textXOffset;
+ titleRect.origin.x += textXOffset;
[self drawTitle:title withFrame:titleRect inView:controlView];
}
}

Powered by Google App Engine
This is Rietveld 408576698