[GFX] Add hostname elider. Add ability to elide strings at the beginning.

[email protected]

Review URL: https://codereview.chromium.org/144513002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248726 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/ui/elide_url.h b/chrome/browser/ui/elide_url.h
index 4842281b..3bf6263f 100644
--- a/chrome/browser/ui/elide_url.h
+++ b/chrome/browser/ui/elide_url.h
@@ -36,4 +36,13 @@
                         float available_pixel_width,
                         const std::string& languages);
 
+// This function takes a GURL object and elides the host to fit within
+// the given width. The function will never elide past the TLD+1 point,
+// but after that, will leading-elide the domain name to fit the width.
+// Example: http://sub.domain.com ---> "...domain.com", or "s...domain.com"
+// depending on the width.
+base::string16 ElideHost(const GURL& host_url,
+                         const gfx::FontList& font_list,
+                         float available_pixel_width);
+
 #endif  // CHROME_BROWSER_UI_ELIDE_URL_H_