diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 21:30:10 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 21:30:10 +0000 |
commit | ddc0e4e7b41a492540c2170c77efc2cb14486497 (patch) | |
tree | 8bcd2eb2784e93fc1bd693f866f3567cd38cc9fd /chrome/browser/autocomplete/autocomplete_popup_view_mac.h | |
parent | 564bbc9325b5e5a8e7b5d4c7e6bd5bba0d5445ac (diff) | |
download | chromium_src-ddc0e4e7b41a492540c2170c77efc2cb14486497.zip chromium_src-ddc0e4e7b41a492540c2170c77efc2cb14486497.tar.gz chromium_src-ddc0e4e7b41a492540c2170c77efc2cb14486497.tar.bz2 |
[Mac] Fix some omnibox breakage for small windows.
Change the code to decorate the contents string normally, then elide
the marked-up string if it doesn't fit.
http://crbug.com/23279
TEST=See bug.
Review URL: http://codereview.chromium.org/264012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28603 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_popup_view_mac.h')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup_view_mac.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h index 2dddd70..3782ef8 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h @@ -93,6 +93,18 @@ class AutocompletePopupViewMac : public AutocompletePopupView { const AutocompleteMatch::ACMatchClassifications &classifications, NSColor* textColor, gfx::Font& font); + // Helper for MatchText() to elide a marked-up string using + // gfx::ElideText() as a model. Modifies |aString| in place. + // TODO(shess): Consider breaking AutocompleteButtonCell out of this + // code, and modifying it to have something like -setMatch:, so that + // these convolutions to expose internals for testing can be + // cleaner. + static NSMutableAttributedString* ElideString( + NSMutableAttributedString* aString, + const std::wstring originalString, + const gfx::Font& font, + const float cellWidth); + private: // Create the popup_ instance if needed. void CreatePopupIfNeeded(); |