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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 312233003: Add fade eliding for Views Labels; related cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refine alignment check; minor additional cleanup. Created 6 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 screen_loc.x(), 604 screen_loc.x(),
605 screen_loc.y(), 605 screen_loc.y(),
606 widget->GetNativeView()); 606 widget->GetNativeView());
607 const gfx::FontList tt_fonts = widget->GetTooltipManager()->GetFontList(); 607 const gfx::FontList tt_fonts = widget->GetTooltipManager()->GetFontList();
608 base::string16 result; 608 base::string16 result;
609 609
610 // First the title. 610 // First the title.
611 if (!title.empty()) { 611 if (!title.empty()) {
612 base::string16 localized_title = title; 612 base::string16 localized_title = title;
613 base::i18n::AdjustStringForLocaleDirection(&localized_title); 613 base::i18n::AdjustStringForLocaleDirection(&localized_title);
614 result.append(ElideText(localized_title, tt_fonts, max_width, 614 result.append(gfx::ElideText(localized_title, tt_fonts, max_width,
615 gfx::ELIDE_AT_END)); 615 gfx::ELIDE_TAIL));
616 } 616 }
617 617
618 // Only show the URL if the url and title differ. 618 // Only show the URL if the url and title differ.
619 if (title != base::UTF8ToUTF16(url.spec())) { 619 if (title != base::UTF8ToUTF16(url.spec())) {
620 if (!result.empty()) 620 if (!result.empty())
621 result.push_back('\n'); 621 result.push_back('\n');
622 622
623 // We need to explicitly specify the directionality of the URL's text to 623 // We need to explicitly specify the directionality of the URL's text to
624 // make sure it is treated as an LTR string when the context is RTL. For 624 // make sure it is treated as an LTR string when the context is RTL. For
625 // example, the URL "http://www.yahoo.com/" appears as 625 // example, the URL "http://www.yahoo.com/" appears as
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1829 DCHECK(apps_page_shortcut_); 1829 DCHECK(apps_page_shortcut_);
1830 // Only perform layout if required. 1830 // Only perform layout if required.
1831 bool visible = chrome::ShouldShowAppsShortcutInBookmarkBar( 1831 bool visible = chrome::ShouldShowAppsShortcutInBookmarkBar(
1832 browser_->profile(), browser_->host_desktop_type()); 1832 browser_->profile(), browser_->host_desktop_type());
1833 if (apps_page_shortcut_->visible() == visible) 1833 if (apps_page_shortcut_->visible() == visible)
1834 return; 1834 return;
1835 apps_page_shortcut_->SetVisible(visible); 1835 apps_page_shortcut_->SetVisible(visible);
1836 UpdateBookmarksSeparatorVisibility(); 1836 UpdateBookmarksSeparatorVisibility();
1837 Layout(); 1837 Layout();
1838 } 1838 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/back_forward_menu_model.cc ('k') | chrome/browser/ui/views/content_setting_bubble_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698