OLD | NEW |
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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <limits> | 10 #include <limits> |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 } | 702 } |
703 | 703 |
704 // static | 704 // static |
705 base::string16 BookmarkBarView::CreateToolTipForURLAndTitle( | 705 base::string16 BookmarkBarView::CreateToolTipForURLAndTitle( |
706 const views::Widget* widget, | 706 const views::Widget* widget, |
707 const gfx::Point& screen_loc, | 707 const gfx::Point& screen_loc, |
708 const GURL& url, | 708 const GURL& url, |
709 const base::string16& title, | 709 const base::string16& title, |
710 Profile* profile) { | 710 Profile* profile) { |
711 const views::TooltipManager* tooltip_manager = widget->GetTooltipManager(); | 711 const views::TooltipManager* tooltip_manager = widget->GetTooltipManager(); |
712 int max_width = tooltip_manager->GetMaxWidth(screen_loc, | 712 int max_width = tooltip_manager->GetMaxWidth(screen_loc); |
713 widget->GetNativeView()); | |
714 const gfx::FontList tt_fonts = tooltip_manager->GetFontList(); | 713 const gfx::FontList tt_fonts = tooltip_manager->GetFontList(); |
715 base::string16 result; | 714 base::string16 result; |
716 | 715 |
717 // First the title. | 716 // First the title. |
718 if (!title.empty()) { | 717 if (!title.empty()) { |
719 base::string16 localized_title = title; | 718 base::string16 localized_title = title; |
720 base::i18n::AdjustStringForLocaleDirection(&localized_title); | 719 base::i18n::AdjustStringForLocaleDirection(&localized_title); |
721 result.append(gfx::ElideText(localized_title, tt_fonts, max_width, | 720 result.append(gfx::ElideText(localized_title, tt_fonts, max_width, |
722 gfx::ELIDE_TAIL)); | 721 gfx::ELIDE_TAIL)); |
723 } | 722 } |
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2091 return; | 2090 return; |
2092 apps_page_shortcut_->SetVisible(visible); | 2091 apps_page_shortcut_->SetVisible(visible); |
2093 UpdateBookmarksSeparatorVisibility(); | 2092 UpdateBookmarksSeparatorVisibility(); |
2094 LayoutAndPaint(); | 2093 LayoutAndPaint(); |
2095 } | 2094 } |
2096 | 2095 |
2097 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2096 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
2098 if (UpdateOtherAndManagedButtonsVisibility()) | 2097 if (UpdateOtherAndManagedButtonsVisibility()) |
2099 LayoutAndPaint(); | 2098 LayoutAndPaint(); |
2100 } | 2099 } |
OLD | NEW |