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

Side by Side Diff: chrome/browser/ui/elide_url.h

Issue 143463006: Remove net dependency from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exclude elide_url.cc and tests from the android build Created 6 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/status_bubble_mac.mm ('k') | chrome/browser/ui/elide_url.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // This file defines utility functions for eliding URLs.
6
7 #ifndef CHROME_BROWSER_UI_ELIDE_URL_H_
8 #define CHROME_BROWSER_UI_ELIDE_URL_H_
9
10 #include <string>
11
12 #include "base/strings/string16.h"
13 #include "url/gurl.h"
14
15 namespace gfx {
16 class FontList;
17 }
18
19 // This function takes a GURL object and elides it. It returns a string
20 // which composed of parts from subdomain, domain, path, filename and query.
21 // A "..." is added automatically at the end if the elided string is bigger
22 // than the |available_pixel_width|. For |available_pixel_width| == 0, a
23 // formatted, but un-elided, string is returned. |languages| is a comma
24 // separated list of ISO 639 language codes and is used to determine what
25 // characters are understood by a user. It should come from
26 // |prefs::kAcceptLanguages|.
27 //
28 // Note: in RTL locales, if the URL returned by this function is going to be
29 // displayed in the UI, then it is likely that the string needs to be marked
30 // as an LTR string (using base::i18n::WrapStringWithLTRFormatting()) so that it
31 // is displayed properly in an RTL context. Please refer to
32 // http://crbug.com/6487 for more information.
33 base::string16 ElideUrl(const GURL& url,
sky 2014/01/29 04:02:14 nit: forward declare GURL.
34 const gfx::FontList& font_list,
35 float available_pixel_width,
36 const std::string& languages);
37
sky 2014/01/29 04:02:14 nit: only one newline here.
38
39 #endif // CHROME_BROWSER_UI_ELIDE_URL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/status_bubble_mac.mm ('k') | chrome/browser/ui/elide_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698