OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/bookmark_bar_view.h" | 5 #include "chrome/browser/views/bookmark_bar_view.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "app/gfx/chrome_canvas.h" | 9 #include "app/gfx/chrome_canvas.h" |
10 #include "app/gfx/text_elider.h" | 10 #include "app/gfx/text_elider.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // text is clipped to fit within the bounds of the monitor. | 142 // text is clipped to fit within the bounds of the monitor. |
143 // | 143 // |
144 // Note that we adjust the direction of both the URL and the title based on the | 144 // Note that we adjust the direction of both the URL and the title based on the |
145 // locale so that pure LTR strings are displayed properly in RTL locales. | 145 // locale so that pure LTR strings are displayed properly in RTL locales. |
146 static std::wstring CreateToolTipForURLAndTitle(const gfx::Point& screen_loc, | 146 static std::wstring CreateToolTipForURLAndTitle(const gfx::Point& screen_loc, |
147 const GURL& url, | 147 const GURL& url, |
148 const std::wstring& title, | 148 const std::wstring& title, |
149 const std::wstring& languages) { | 149 const std::wstring& languages) { |
150 const gfx::Rect monitor_bounds = win_util::GetMonitorBoundsForRect( | 150 const gfx::Rect monitor_bounds = win_util::GetMonitorBoundsForRect( |
151 gfx::Rect(screen_loc.x(), screen_loc.y(), 1, 1)); | 151 gfx::Rect(screen_loc.x(), screen_loc.y(), 1, 1)); |
152 ChromeFont tt_font = views::TooltipManager::GetDefaultFont(); | 152 gfx::Font tt_font = views::TooltipManager::GetDefaultFont(); |
153 std::wstring result; | 153 std::wstring result; |
154 | 154 |
155 // First the title. | 155 // First the title. |
156 if (!title.empty()) { | 156 if (!title.empty()) { |
157 std::wstring localized_title; | 157 std::wstring localized_title; |
158 if (l10n_util::AdjustStringForLocaleDirection(title, &localized_title)) | 158 if (l10n_util::AdjustStringForLocaleDirection(title, &localized_title)) |
159 result.append(gfx::ElideText(localized_title, | 159 result.append(gfx::ElideText(localized_title, |
160 tt_font, | 160 tt_font, |
161 monitor_bounds.width())); | 161 monitor_bounds.width())); |
162 else | 162 else |
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 } | 1532 } |
1533 | 1533 |
1534 void BookmarkBarView::StopThrobbing(bool immediate) { | 1534 void BookmarkBarView::StopThrobbing(bool immediate) { |
1535 if (!throbbing_view_) | 1535 if (!throbbing_view_) |
1536 return; | 1536 return; |
1537 | 1537 |
1538 // If not immediate, cycle through 2 more complete cycles. | 1538 // If not immediate, cycle through 2 more complete cycles. |
1539 throbbing_view_->StartThrobbing(immediate ? 0 : 4); | 1539 throbbing_view_->StartThrobbing(immediate ? 0 : 4); |
1540 throbbing_view_ = NULL; | 1540 throbbing_view_ = NULL; |
1541 } | 1541 } |
OLD | NEW |