| OLD | NEW | 
|    1 // Copyright 2013 The Chromium Authors. All rights reserved. |    1 // Copyright 2013 The Chromium Authors. All rights reserved. | 
|    2 // Use of this source code is governed by a BSD-style license that can be |    2 // Use of this source code is governed by a BSD-style license that can be | 
|    3 // found in the LICENSE file. |    3 // found in the LICENSE file. | 
|    4  |    4  | 
|    5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h" |    5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h" | 
|    6  |    6  | 
|    7 #include <stddef.h> |    7 #include <stddef.h> | 
|    8  |    8  | 
|    9 #include <algorithm> |    9 #include <algorithm> | 
|   10 #include <cmath> |   10 #include <cmath> | 
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  629  |  629  | 
|  630 - (CGFloat)drawMatchPart:(NSAttributedString*)attributedString |  630 - (CGFloat)drawMatchPart:(NSAttributedString*)attributedString | 
|  631                withFrame:(NSRect)cellFrame |  631                withFrame:(NSRect)cellFrame | 
|  632                   origin:(NSPoint)origin |  632                   origin:(NSPoint)origin | 
|  633             withMaxWidth:(int)maxWidth |  633             withMaxWidth:(int)maxWidth | 
|  634             forDarkTheme:(BOOL)isDarkTheme { |  634             forDarkTheme:(BOOL)isDarkTheme { | 
|  635   NSRect renderRect = NSIntersectionRect( |  635   NSRect renderRect = NSIntersectionRect( | 
|  636       cellFrame, NSOffsetRect(cellFrame, origin.x, origin.y)); |  636       cellFrame, NSOffsetRect(cellFrame, origin.x, origin.y)); | 
|  637   renderRect.size.width = |  637   renderRect.size.width = | 
|  638       std::min(NSWidth(renderRect), static_cast<CGFloat>(maxWidth)); |  638       std::min(NSWidth(renderRect), static_cast<CGFloat>(maxWidth)); | 
 |  639   renderRect.size.height = std::min(NSWidth(renderRect), kDefaultTextHeight); | 
|  639   if (!NSIsEmptyRect(renderRect)) { |  640   if (!NSIsEmptyRect(renderRect)) { | 
|  640     [attributedString drawWithRect:FlipIfRTL(renderRect, cellFrame) |  641     [attributedString drawWithRect:FlipIfRTL(renderRect, cellFrame) | 
|  641                            options:NSStringDrawingUsesLineFragmentOrigin | |  642                            options:NSStringDrawingUsesLineFragmentOrigin | | 
|  642                                    NSStringDrawingTruncatesLastVisibleLine]; |  643                                    NSStringDrawingTruncatesLastVisibleLine]; | 
|  643   } |  644   } | 
|  644   return NSWidth(renderRect); |  645   return NSWidth(renderRect); | 
|  645 } |  646 } | 
|  646  |  647  | 
|  647 + (CGFloat)computeContentsOffset:(const AutocompleteMatch&)match { |  648 + (CGFloat)computeContentsOffset:(const AutocompleteMatch&)match { | 
|  648   const base::string16& inputText = base::UTF8ToUTF16( |  649   const base::string16& inputText = base::UTF8ToUTF16( | 
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  723 } |  724 } | 
|  724  |  725  | 
|  725 + (CGFloat)getContentTextHeightForDoubleLine:(BOOL)isDoubleLine { |  726 + (CGFloat)getContentTextHeightForDoubleLine:(BOOL)isDoubleLine { | 
|  726   CGFloat height = kDefaultTextHeight + 2 * GetVerticalMargin(); |  727   CGFloat height = kDefaultTextHeight + 2 * GetVerticalMargin(); | 
|  727   if (isDoubleLine) |  728   if (isDoubleLine) | 
|  728     height += kDefaultTextHeight + kDefaultVerticalMargin; |  729     height += kDefaultTextHeight + kDefaultVerticalMargin; | 
|  729   return height; |  730   return height; | 
|  730 } |  731 } | 
|  731  |  732  | 
|  732 @end |  733 @end | 
| OLD | NEW |