diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-09 22:15:25 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-09 22:15:25 +0000 |
commit | dbb97ba9f0608c2ebf6f02f750df9c5e433b770e (patch) | |
tree | 6da1f4050039906a020366d937107190c86b6776 /chrome/browser/ui | |
parent | 9045c60ac4a8cbeeb911aadcd771fb4ec020703c (diff) | |
download | chromium_src-dbb97ba9f0608c2ebf6f02f750df9c5e433b770e.zip chromium_src-dbb97ba9f0608c2ebf6f02f750df9c5e433b770e.tar.gz chromium_src-dbb97ba9f0608c2ebf6f02f750df9c5e433b770e.tar.bz2 |
Move text_elider to gfx.
R=sky@chromium.org
http://crbug.com/103304
Review URL: https://codereview.chromium.org/23731010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222106 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
27 files changed, 74 insertions, 74 deletions
diff --git a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc index 89fe155..c65a732 100644 --- a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc +++ b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc @@ -10,7 +10,7 @@ #include "chrome/common/chrome_switches.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" #if defined(USE_AURA) #include "ui/aura/root_window.h" @@ -31,11 +31,11 @@ const int kMessageTextMaxCols = 132; const int kDefaultPromptMaxRows = 24; const int kDefaultPromptMaxCols = 132; void EnforceMaxTextSize(const string16& in_string, string16* out_string) { - ui::ElideRectangleString(in_string, kMessageTextMaxRows, + gfx::ElideRectangleString(in_string, kMessageTextMaxRows, kMessageTextMaxCols, false, out_string); } void EnforceMaxPromptSize(const string16& in_string, string16* out_string) { - ui::ElideRectangleString(in_string, kDefaultPromptMaxRows, + gfx::ElideRectangleString(in_string, kDefaultPromptMaxRows, kDefaultPromptMaxCols, false, out_string); } #else @@ -44,10 +44,10 @@ void EnforceMaxPromptSize(const string16& in_string, string16* out_string) { const int kMessageTextMaxSize = 3000; const int kDefaultPromptMaxSize = 2000; void EnforceMaxTextSize(const string16& in_string, string16* out_string) { - ui::ElideString(in_string, kMessageTextMaxSize, out_string); + gfx::ElideString(in_string, kMessageTextMaxSize, out_string); } void EnforceMaxPromptSize(const string16& in_string, string16* out_string) { - ui::ElideString(in_string, kDefaultPromptMaxSize, out_string); + gfx::ElideString(in_string, kDefaultPromptMaxSize, out_string); } #endif diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc index 043e8c1..837025f 100644 --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc @@ -15,10 +15,10 @@ #include "grit/webkit_resources.h" #include "third_party/WebKit/public/web/WebAutofillClient.h" #include "ui/base/events/event.h" -#include "ui/base/text/text_elider.h" #include "ui/gfx/display.h" #include "ui/gfx/rect_conversions.h" #include "ui/gfx/screen.h" +#include "ui/gfx/text_elider.h" #include "ui/gfx/vector2d.h" using base::WeakPtr; @@ -143,16 +143,16 @@ void AutofillPopupControllerImpl::Show( // Each field recieves space in proportion to its length. int name_size = available_width * name_width / total_text_length; - names_[i] = ui::ElideText(names_[i], + names_[i] = gfx::ElideText(names_[i], GetNameFontForRow(i), name_size, - ui::ELIDE_AT_END); + gfx::ELIDE_AT_END); int subtext_size = available_width * subtext_width / total_text_length; - subtexts_[i] = ui::ElideText(subtexts_[i], + subtexts_[i] = gfx::ElideText(subtexts_[i], subtext_font(), subtext_size, - ui::ELIDE_AT_END); + gfx::ELIDE_AT_END); } #endif diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.mm b/chrome/browser/ui/cocoa/download/download_item_cell.mm index c4e5e4d..4928951 100644 --- a/chrome/browser/ui/cocoa/download/download_item_cell.mm +++ b/chrome/browser/ui/cocoa/download/download_item_cell.mm @@ -16,7 +16,7 @@ #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" #include "ui/gfx/canvas_skia_paint.h" #include "ui/gfx/font.h" #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" @@ -378,7 +378,7 @@ using content::DownloadItem; [font pointSize]); return base::SysUTF16ToNSString( - ui::ElideFilename(downloadPath_, font_chr, availableWidth)); + gfx::ElideFilename(downloadPath_, font_chr, availableWidth)); } - (NSString*)elideStatus:(int)availableWidth { @@ -386,11 +386,11 @@ using content::DownloadItem; gfx::Font font_chr(base::SysNSStringToUTF8([font fontName]), [font pointSize]); - return base::SysUTF16ToNSString(ui::ElideText( + return base::SysUTF16ToNSString(gfx::ElideText( base::SysNSStringToUTF16([self secondaryTitle]), font_chr, availableWidth, - ui::ELIDE_AT_END)); + gfx::ELIDE_AT_END)); } - (ui::ThemeProvider*)backgroundThemeWrappingProvider: diff --git a/chrome/browser/ui/cocoa/download/download_item_controller.mm b/chrome/browser/ui/cocoa/download/download_item_controller.mm index a403797..1c7d295 100644 --- a/chrome/browser/ui/cocoa/download/download_item_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_item_controller.mm @@ -29,7 +29,7 @@ #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" #include "ui/gfx/font.h" #include "ui/gfx/image/image.h" diff --git a/chrome/browser/ui/cocoa/external_protocol_dialog.mm b/chrome/browser/ui/cocoa/external_protocol_dialog.mm index 0b66547..d4aacba 100644 --- a/chrome/browser/ui/cocoa/external_protocol_dialog.mm +++ b/chrome/browser/ui/cocoa/external_protocol_dialog.mm @@ -13,7 +13,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util_mac.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" /////////////////////////////////////////////////////////////////////////////// // ExternalProtocolHandler @@ -65,7 +65,7 @@ void ExternalProtocolHandler::RunExternalProtocolDialog( const int kMaxUrlWithoutSchemeSize = 256; string16 elided_url_without_scheme; - ui::ElideString(ASCIIToUTF16(url_.possibly_invalid_spec()), + gfx::ElideString(ASCIIToUTF16(url_.possibly_invalid_spec()), kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); NSString* urlString = l10n_util::GetNSStringFWithFixup( diff --git a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm index 25b4c71..1a2abc7 100644 --- a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm +++ b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm @@ -7,7 +7,7 @@ #import "base/logging.h" #include "base/strings/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/location_bar/location_icon_decoration.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" #include "ui/gfx/font.h" namespace { @@ -88,8 +88,8 @@ CGFloat EVBubbleDecoration::GetWidthForSpace(CGFloat width) { // prefix and the trailing country code in place. gfx::Font font(GetFont()); NSString* elided_label = base::SysUTF16ToNSString( - ui::ElideText(base::SysNSStringToUTF16(full_label_), font, width_left, - ui::ELIDE_IN_MIDDLE)); + gfx::ElideText(base::SysNSStringToUTF16(full_label_), font, width_left, + gfx::ELIDE_IN_MIDDLE)); // Use the elided label. SetLabel(elided_label); diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm index 82e0d18..f41c36e 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm @@ -9,7 +9,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" namespace { diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.mm b/chrome/browser/ui/cocoa/status_bubble_mac.mm index 0545797..b5ec742 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac.mm +++ b/chrome/browser/ui/cocoa/status_bubble_mac.mm @@ -19,7 +19,7 @@ #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" #include "ui/base/cocoa/window_size_constants.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" #include "ui/gfx/font.h" #include "ui/gfx/point.h" @@ -154,7 +154,7 @@ void StatusBubbleMac::SetURL(const GURL& url, const std::string& languages) { [font pointSize]); string16 original_url_text = net::FormatUrl(url, languages); - string16 status = ui::ElideUrl(url, font_chr, text_width, languages); + string16 status = gfx::ElideUrl(url, font_chr, text_width, languages); SetText(status, true); @@ -623,7 +623,7 @@ void StatusBubbleMac::ExpandBubble() { NSFont* font = [[window_ contentView] font]; gfx::Font font_chr(base::SysNSStringToUTF8([font fontName]), [font pointSize]); - string16 expanded_url = ui::ElideUrl( + string16 expanded_url = gfx::ElideUrl( url_, font_chr, max_bubble_width, languages_); // Scale width from gfx::Font in view coordinates to window coordinates. diff --git a/chrome/browser/ui/external_protocol_dialog_delegate.cc b/chrome/browser/ui/external_protocol_dialog_delegate.cc index aa36808..e0129c2 100644 --- a/chrome/browser/ui/external_protocol_dialog_delegate.cc +++ b/chrome/browser/ui/external_protocol_dialog_delegate.cc @@ -13,7 +13,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" ExternalProtocolDialogDelegate::ExternalProtocolDialogDelegate(const GURL& url) : ProtocolDialogDelegate(url) { @@ -32,9 +32,9 @@ string16 ExternalProtocolDialogDelegate::GetMessageText() const { UTF8ToUTF16(ShellIntegration::GetApplicationForProtocol(url())); string16 elided_url_without_scheme; string16 elided_command; - ui::ElideString(ASCIIToUTF16(url().possibly_invalid_spec()), + gfx::ElideString(ASCIIToUTF16(url().possibly_invalid_spec()), kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); - ui::ElideString(command, kMaxCommandSize, &elided_command); + gfx::ElideString(command, kMaxCommandSize, &elided_command); string16 message_text = l10n_util::GetStringFUTF16( IDS_EXTERNAL_PROTOCOL_INFORMATION, diff --git a/chrome/browser/ui/gtk/avatar_menu_item_gtk.cc b/chrome/browser/ui/gtk/avatar_menu_item_gtk.cc index 791cd42..aabd490 100644 --- a/chrome/browser/ui/gtk/avatar_menu_item_gtk.cc +++ b/chrome/browser/ui/gtk/avatar_menu_item_gtk.cc @@ -20,10 +20,10 @@ #include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/gtk_util.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/text_elider.h" namespace { @@ -227,10 +227,10 @@ void AvatarMenuItemGtk::Init(GtkThemeService* theme_service) { // The user name label. GtkWidget* item_vbox = gtk_vbox_new(FALSE, 0); GtkWidget* name_label = NULL; - string16 elided_name = ui::ElideText(item_.name, + string16 elided_name = gfx::ElideText(item_.name, gfx::Font(), kUserNameMaxWidth, - ui::ELIDE_AT_END); + gfx::ELIDE_AT_END); name_label = theme_service->BuildLabel(UTF16ToUTF8(elided_name), ui::kGdkBlack); diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc index 8b9ab4a..1697fe9 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc @@ -25,10 +25,10 @@ #include "ui/base/gtk/gtk_screen_util.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" #include "ui/gfx/canvas_skia_paint.h" #include "ui/gfx/font.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/text_elider.h" namespace { @@ -277,10 +277,10 @@ std::string BuildMenuLabelFor(const BookmarkNode* node) { // This breaks on word boundaries. Ideally we would break on character // boundaries. std::string elided_name = UTF16ToUTF8( - ui::TruncateString(node->GetTitle(), kMaxCharsOnAMenuLabel)); + gfx::TruncateString(node->GetTitle(), kMaxCharsOnAMenuLabel)); if (elided_name.empty()) { - elided_name = UTF16ToUTF8(ui::TruncateString( + elided_name = UTF16ToUTF8(gfx::TruncateString( UTF8ToUTF16(node->url().possibly_invalid_spec()), kMaxCharsOnAMenuLabel)); } diff --git a/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc b/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc index aa9e25e..6a541e2 100644 --- a/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc @@ -31,9 +31,9 @@ #include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/models/simple_menu_model.h" -#include "ui/base/text/text_elider.h" #include "ui/gfx/font.h" #include "ui/gfx/gtk_util.h" +#include "ui/gfx/text_elider.h" using content::PluginService; using content::WebContents; @@ -49,11 +49,11 @@ const int kMinMediaMenuButtonWidth = 100; const int kMaxMediaMenuButtonWidth = 600; std::string BuildElidedText(const std::string& input) { - return UTF16ToUTF8(ui::ElideText( + return UTF16ToUTF8(gfx::ElideText( UTF8ToUTF16(input), gfx::Font(), kMaxLinkPixelSize, - ui::ELIDE_AT_END)); + gfx::ELIDE_AT_END)); } } // namespace diff --git a/chrome/browser/ui/gtk/download/download_item_gtk.cc b/chrome/browser/ui/gtk/download/download_item_gtk.cc index 144a6b3..1ba3895 100644 --- a/chrome/browser/ui/gtk/download/download_item_gtk.cc +++ b/chrome/browser/ui/gtk/download/download_item_gtk.cc @@ -31,11 +31,11 @@ #include "ui/base/animation/slide_animation.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" #include "ui/gfx/canvas_skia_paint.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/image/image.h" #include "ui/gfx/skia_utils_gtk.h" +#include "ui/gfx/text_elider.h" #include "ui/gfx/text_utils.h" namespace { @@ -492,7 +492,7 @@ void DownloadItemGtk::UpdateNameLabel() { ui::ResourceBundle::BaseFont); string16 filename; if (!disabled_while_opening_) { - filename = ui::ElideFilename( + filename = gfx::ElideFilename( download()->GetFileNameToReportUser(), font_list, kTextWidth); } else { // First, Calculate the download status opening string width. @@ -501,7 +501,7 @@ void DownloadItemGtk::UpdateNameLabel() { int status_string_width = gfx::GetStringWidth(status_string, font_list); // Then, elide the file name. string16 filename_string = - ui::ElideFilename(download()->GetFileNameToReportUser(), font_list, + gfx::ElideFilename(download()->GetFileNameToReportUser(), font_list, kTextWidth - status_string_width); // Last, concat the whole string. filename = l10n_util::GetStringFUTF16(IDS_DOWNLOAD_STATUS_OPENING, diff --git a/chrome/browser/ui/gtk/global_history_menu.cc b/chrome/browser/ui/gtk/global_history_menu.cc index 0054641..9235762 100644 --- a/chrome/browser/ui/gtk/global_history_menu.cc +++ b/chrome/browser/ui/gtk/global_history_menu.cc @@ -29,9 +29,9 @@ #include "grit/generated_resources.h" #include "ui/base/gtk/owned_widget_gtk.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/text/text_elider.h" #include "ui/gfx/codec/png_codec.h" #include "ui/gfx/gtk_util.h" +#include "ui/gfx/text_elider.h" using content::OpenURLParams; @@ -198,7 +198,7 @@ GtkWidget* GlobalHistoryMenu::AddHistoryItemToMenu(HistoryItem* item, if (title.empty()) title = UTF8ToUTF16(url_string); - ui::ElideString(title, kMaximumMenuWidthInChars, &title); + gfx::ElideString(title, kMaximumMenuWidthInChars, &title); GtkWidget* menu_item = gtk_menu_item_new_with_label( UTF16ToUTF8(title).c_str()); diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc index 2b51a0a..36cddb7 100644 --- a/chrome/browser/ui/gtk/gtk_util.cc +++ b/chrome/browser/ui/gtk/gtk_util.cc @@ -40,11 +40,11 @@ #include "ui/base/gtk/gtk_screen_util.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" #include "ui/base/x/x11_util.h" #include "ui/gfx/image/cairo_cached_surface.h" #include "ui/gfx/image/image.h" #include "ui/gfx/pango_util.h" +#include "ui/gfx/text_elider.h" #include "url/gurl.h" // These conflict with base/tracked_objects.h, so need to come last. @@ -648,7 +648,7 @@ std::string BuildTooltipTitleFor(string16 title, const GURL& url) { const std::string& url_str = url.possibly_invalid_spec(); const std::string& title_str = UTF16ToUTF8(title); - std::string truncated_url = UTF16ToUTF8(ui::TruncateString( + std::string truncated_url = UTF16ToUTF8(gfx::TruncateString( UTF8ToUTF16(url_str), kMaxTooltipURLLength)); gchar* escaped_url_cstr = g_markup_escape_text(truncated_url.c_str(), truncated_url.size()); @@ -658,7 +658,7 @@ std::string BuildTooltipTitleFor(string16 title, const GURL& url) { if (url_str == title_str || title.empty()) { return escaped_url; } else { - std::string truncated_title = UTF16ToUTF8(ui::TruncateString( + std::string truncated_title = UTF16ToUTF8(gfx::TruncateString( title, kMaxTooltipTitleLength)); gchar* escaped_title_cstr = g_markup_escape_text(truncated_title.c_str(), truncated_title.size()); diff --git a/chrome/browser/ui/gtk/status_bubble_gtk.cc b/chrome/browser/ui/gtk/status_bubble_gtk.cc index 3d4fc79..ad7f7f7 100644 --- a/chrome/browser/ui/gtk/status_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/status_bubble_gtk.cc @@ -20,8 +20,8 @@ #include "ui/base/animation/slide_animation.h" #include "ui/base/gtk/gtk_compat.h" #include "ui/base/gtk/gtk_hig_constants.h" -#include "ui/base/text/text_elider.h" #include "ui/gfx/font.h" +#include "ui/gfx/text_elider.h" namespace { @@ -113,9 +113,9 @@ void StatusBubbleGtk::SetStatusTextToURL() { } // TODO(tc): We don't actually use gfx::Font as the font in the status - // bubble. We should extend ui::ElideUrl to take some sort of pango font. + // bubble. We should extend gfx::ElideUrl to take some sort of pango font. url_text_ = UTF16ToUTF8( - ui::ElideUrl(url_, gfx::Font(), desired_width, languages_)); + gfx::ElideUrl(url_, gfx::Font(), desired_width, languages_)); SetStatusTextTo(url_text_); } diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc index a590720..5c08f33 100644 --- a/chrome/browser/ui/login/login_prompt.cc +++ b/chrome/browser/ui/login/login_prompt.cc @@ -27,7 +27,7 @@ #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" using autofill::PasswordForm; using content::BrowserThread; @@ -441,7 +441,7 @@ void LoginDialogCallback(const GURL& request_url, // The realm is controlled by the remote server, so there is no reason // to believe it is of a reasonable length. string16 elided_realm; - ui::ElideString(UTF8ToUTF16(auth_info->realm), 120, &elided_realm); + gfx::ElideString(UTF8ToUTF16(auth_info->realm), 120, &elided_realm); string16 host_and_port = ASCIIToUTF16(request_url.scheme() + "://" + auth_info->challenger.ToString()); diff --git a/chrome/browser/ui/omnibox/location_bar_util.cc b/chrome/browser/ui/omnibox/location_bar_util.cc index efcf26b..71220d3 100644 --- a/chrome/browser/ui/omnibox/location_bar_util.cc +++ b/chrome/browser/ui/omnibox/location_bar_util.cc @@ -9,10 +9,10 @@ #include "chrome/browser/extensions/extension_action.h" #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/effects/SkGradientShader.h" -#include "ui/base/text/text_elider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/rect.h" +#include "ui/gfx/text_elider.h" namespace location_bar_util { @@ -24,7 +24,7 @@ string16 CalculateMinString(const string16& description) { string16 min_string; if (chop_index == string16::npos) { // No dot or whitespace, truncate to at most 3 chars. - min_string = ui::TruncateString(description, 3); + min_string = gfx::TruncateString(description, 3); } else { min_string = description.substr(0, chop_index); } diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc index cdce413..9f26f69 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -28,9 +28,9 @@ #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" #include "ui/base/window_open_disposition.h" #include "ui/gfx/favicon_size.h" +#include "ui/gfx/text_elider.h" using content::NavigationController; using content::NavigationEntry; @@ -107,7 +107,7 @@ string16 BackForwardMenuModel::GetLabelAt(int index) const { string16 menu_text(entry->GetTitleForDisplay( profile->GetPrefs()->GetString(prefs::kAcceptLanguages))); menu_text = - ui::ElideText(menu_text, gfx::Font(), kMaxWidth, ui::ELIDE_AT_END); + gfx::ElideText(menu_text, gfx::Font(), kMaxWidth, gfx::ELIDE_AT_END); #if !defined(OS_MACOSX) for (size_t i = menu_text.find('&'); i != string16::npos; diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index c8fbf08..9bb4a52 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc @@ -68,10 +68,10 @@ #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" #include "ui/base/theme_provider.h" #include "ui/base/window_open_disposition.h" #include "ui/gfx/canvas.h" +#include "ui/gfx/text_elider.h" #include "ui/views/button_drag_utils.h" #include "ui/views/controls/button/menu_button.h" #include "ui/views/controls/label.h" @@ -616,8 +616,8 @@ string16 BookmarkBarView::CreateToolTipForURLAndTitle( if (!title.empty()) { string16 localized_title = title; base::i18n::AdjustStringForLocaleDirection(&localized_title); - result.append(ui::ElideText(localized_title, tt_fonts, max_width, - ui::ELIDE_AT_END)); + result.append(gfx::ElideText(localized_title, tt_fonts, max_width, + gfx::ELIDE_AT_END)); } // Only show the URL if the url and title differ. @@ -633,7 +633,7 @@ string16 BookmarkBarView::CreateToolTipForURLAndTitle( // default. std::string languages = profile->GetPrefs()->GetString( prefs::kAcceptLanguages); - string16 elided_url(ui::ElideUrl(url, tt_fonts, max_width, languages)); + string16 elided_url(gfx::ElideUrl(url, tt_fonts, max_width, languages)); elided_url = base::i18n::GetDisplayStringInLTRDirectionality(elided_url); result.append(elided_url); } diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc index dc53662..e9004e3 100644 --- a/chrome/browser/ui/views/download/download_item_view.cc +++ b/chrome/browser/ui/views/download/download_item_view.cc @@ -36,11 +36,11 @@ #include "ui/base/events/event.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" #include "ui/base/theme_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/text_elider.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/label.h" #include "ui/views/widget/root_view.h" @@ -748,7 +748,7 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) { if (!IsShowingWarningDialog()) { string16 filename; if (!disabled_while_opening_) { - filename = ui::ElideFilename(download()->GetFileNameToReportUser(), + filename = gfx::ElideFilename(download()->GetFileNameToReportUser(), font_list_, kTextWidth); } else { // First, Calculate the download status opening string width. @@ -757,7 +757,7 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) { int status_string_width = font_list_.GetStringWidth(status_string); // Then, elide the file name. string16 filename_string = - ui::ElideFilename(download()->GetFileNameToReportUser(), font_list_, + gfx::ElideFilename(download()->GetFileNameToReportUser(), font_list_, kTextWidth - status_string_width); // Last, concat the whole string. filename = l10n_util::GetStringFUTF16(IDS_DOWNLOAD_STATUS_OPENING, diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc index 5ec0dc8..6418fc0 100644 --- a/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc +++ b/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc @@ -35,8 +35,8 @@ #include "grit/ui_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" #include "ui/gfx/render_text.h" +#include "ui/gfx/text_elider.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" @@ -343,8 +343,8 @@ class InstalledBubbleContent : public views::View, // Word-wrap the full label text. const gfx::Font font; std::vector<string16> lines; - ui::ElideRectangleText(full_text, font, contents_area.width(), - contents_area.height(), ui::ELIDE_LONG_WORDS, + gfx::ElideRectangleText(full_text, font, contents_area.width(), + contents_area.height(), gfx::ELIDE_LONG_WORDS, &lines); gfx::Point position = gfx::Point( diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc index 1b04dbb..3405c5c 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.cc +++ b/chrome/browser/ui/views/external_protocol_dialog.cc @@ -18,7 +18,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" #include "ui/views/controls/message_box_view.h" #include "ui/views/widget/widget.h" @@ -134,9 +134,9 @@ ExternalProtocolDialog::ExternalProtocolDialog(WebContents* web_contents, const int kMaxCommandSize = 256; string16 elided_url_without_scheme; string16 elided_command; - ui::ElideString(ASCIIToUTF16(url.possibly_invalid_spec()), + gfx::ElideString(ASCIIToUTF16(url.possibly_invalid_spec()), kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); - ui::ElideString(WideToUTF16Hack(command), kMaxCommandSize, &elided_command); + gfx::ElideString(WideToUTF16Hack(command), kMaxCommandSize, &elided_command); string16 message_text = l10n_util::GetStringFUTF16( IDS_EXTERNAL_PROTOCOL_INFORMATION, diff --git a/chrome/browser/ui/views/frame/global_menu_bar_x11.cc b/chrome/browser/ui/views/frame/global_menu_bar_x11.cc index 674c69f..24198aa 100644 --- a/chrome/browser/ui/views/frame/global_menu_bar_x11.cc +++ b/chrome/browser/ui/views/frame/global_menu_bar_x11.cc @@ -31,7 +31,7 @@ #include "ui/base/accelerators/menu_label_accelerator_util_linux.h" #include "ui/base/keycodes/keyboard_code_conversion_x.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/text/text_elider.h" +#include "ui/gfx/text_elider.h" // libdbusmenu-glib types typedef struct _DbusmenuMenuitem DbusmenuMenuitem; @@ -524,7 +524,7 @@ void GlobalMenuBarX11::AddHistoryItemToMenu(HistoryItem* item, if (title.empty()) title = UTF8ToUTF16(url_string); - ui::ElideString(title, kMaximumMenuWidthInChars, &title); + gfx::ElideString(title, kMaximumMenuWidthInChars, &title); DbusmenuMenuitem* menu_item = BuildMenuItem(UTF16ToUTF8(title), tag); g_signal_connect(menu_item, "item-activated", diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc index fe2225f..8afee93 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc @@ -21,12 +21,12 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/text/text_elider.h" #include "ui/base/theme_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/image/image.h" #include "ui/gfx/render_text.h" +#include "ui/gfx/text_elider.h" #include "ui/native_theme/native_theme.h" #if defined(OS_WIN) @@ -517,7 +517,7 @@ void OmniboxResultView::Elide(Runs* runs, int remaining_width) const { (*j)->GetPrimaryFont().DeriveFont(0, gfx::Font::BOLD) : (*j)->GetPrimaryFont()); string16 elided_text( - ui::ElideText((*j)->text(), font, remaining_width, ui::ELIDE_AT_END)); + gfx::ElideText((*j)->text(), font, remaining_width, gfx::ELIDE_AT_END)); Classifications::reverse_iterator prior(j + 1); const bool on_first_classification = (prior == i->classifications.rend()); if (elided_text.empty() && (remaining_width >= ellipsis_width_) && diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc index 4c290e0..0fefaee 100644 --- a/chrome/browser/ui/views/status_bubble_views.cc +++ b/chrome/browser/ui/views/status_bubble_views.cc @@ -21,12 +21,12 @@ #include "ui/base/animation/animation_delegate.h" #include "ui/base/animation/linear_animation.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" #include "ui/base/theme_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/point.h" #include "ui/gfx/screen.h" #include "ui/gfx/skia_util.h" +#include "ui/gfx/text_elider.h" #include "ui/native_theme/native_theme.h" #include "ui/views/controls/label.h" #include "ui/views/controls/scrollbar/native_scroll_bar.h" @@ -663,7 +663,7 @@ void StatusBubbleViews::SetURL(const GURL& url, const std::string& languages) { gfx::Rect popup_bounds = popup_->GetWindowBoundsInScreen(); int text_width = static_cast<int>(popup_bounds.width() - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding - 1); - url_text_ = ui::ElideUrl(url, view_->Label::font(), text_width, languages); + url_text_ = gfx::ElideUrl(url, view_->Label::font(), text_width, languages); // An URL is always treated as a left-to-right string. On right-to-left UIs // we need to explicitly mark the URL as LTR to make sure it is displayed @@ -820,7 +820,7 @@ void StatusBubbleViews::ExpandBubble() { // still be too long to fit) before expanding bubble. gfx::Rect popup_bounds = popup_->GetWindowBoundsInScreen(); int max_status_bubble_width = GetMaxStatusBubbleWidth(); - url_text_ = ui::ElideUrl(url_, view_->Label::font(), + url_text_ = gfx::ElideUrl(url_, view_->Label::font(), max_status_bubble_width, languages_); int expanded_bubble_width =std::max(GetStandardStatusBubbleWidth(), std::min(view_->Label::font().GetStringWidth(url_text_) + diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc index fde9889..031b2ba 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc @@ -32,7 +32,6 @@ #include "ui/base/layout.h" #include "ui/base/models/list_selection_model.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/base/text/text_elider.h" #include "ui/base/theme_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_analysis.h" @@ -40,6 +39,7 @@ #include "ui/gfx/font.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/path.h" +#include "ui/gfx/text_elider.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/widget/tooltip_manager.h" #include "ui/views/widget/widget.h" |