summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_popup_view_mac.h
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 21:30:10 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 21:30:10 +0000
commitddc0e4e7b41a492540c2170c77efc2cb14486497 (patch)
tree8bcd2eb2784e93fc1bd693f866f3567cd38cc9fd /chrome/browser/autocomplete/autocomplete_popup_view_mac.h
parent564bbc9325b5e5a8e7b5d4c7e6bd5bba0d5445ac (diff)
downloadchromium_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.h12
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();