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

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

Issue 916423002: Tooltip Cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win build fix Created 5 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
« no previous file with comments | « ash/shell.cc ('k') | ui/views/corewm/tooltip.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 throbbing_view_ = NULL; 683 throbbing_view_ = NULL;
684 } 684 }
685 685
686 // static 686 // static
687 base::string16 BookmarkBarView::CreateToolTipForURLAndTitle( 687 base::string16 BookmarkBarView::CreateToolTipForURLAndTitle(
688 const views::Widget* widget, 688 const views::Widget* widget,
689 const gfx::Point& screen_loc, 689 const gfx::Point& screen_loc,
690 const GURL& url, 690 const GURL& url,
691 const base::string16& title, 691 const base::string16& title,
692 Profile* profile) { 692 Profile* profile) {
693 int max_width = views::TooltipManager::GetMaxWidth( 693 const views::TooltipManager* tooltip_manager = widget->GetTooltipManager();
694 screen_loc.x(), 694 int max_width = tooltip_manager->GetMaxWidth(screen_loc,
695 screen_loc.y(), 695 widget->GetNativeView());
696 widget->GetNativeView()); 696 const gfx::FontList tt_fonts = tooltip_manager->GetFontList();
697 const gfx::FontList tt_fonts = widget->GetTooltipManager()->GetFontList();
698 base::string16 result; 697 base::string16 result;
699 698
700 // First the title. 699 // First the title.
701 if (!title.empty()) { 700 if (!title.empty()) {
702 base::string16 localized_title = title; 701 base::string16 localized_title = title;
703 base::i18n::AdjustStringForLocaleDirection(&localized_title); 702 base::i18n::AdjustStringForLocaleDirection(&localized_title);
704 result.append(gfx::ElideText(localized_title, tt_fonts, max_width, 703 result.append(gfx::ElideText(localized_title, tt_fonts, max_width,
705 gfx::ELIDE_TAIL)); 704 gfx::ELIDE_TAIL));
706 } 705 }
707 706
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 return; 2071 return;
2073 apps_page_shortcut_->SetVisible(visible); 2072 apps_page_shortcut_->SetVisible(visible);
2074 UpdateBookmarksSeparatorVisibility(); 2073 UpdateBookmarksSeparatorVisibility();
2075 LayoutAndPaint(); 2074 LayoutAndPaint();
2076 } 2075 }
2077 2076
2078 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { 2077 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() {
2079 if (UpdateOtherAndManagedButtonsVisibility()) 2078 if (UpdateOtherAndManagedButtonsVisibility())
2080 LayoutAndPaint(); 2079 LayoutAndPaint();
2081 } 2080 }
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ui/views/corewm/tooltip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698