OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 if (!result.empty()) | 150 if (!result.empty()) |
151 result.append(views::TooltipManager::GetLineSeparator()); | 151 result.append(views::TooltipManager::GetLineSeparator()); |
152 | 152 |
153 // We need to explicitly specify the directionality of the URL's text to | 153 // We need to explicitly specify the directionality of the URL's text to |
154 // make sure it is treated as an LTR string when the context is RTL. For | 154 // make sure it is treated as an LTR string when the context is RTL. For |
155 // example, the URL "http://www.yahoo.com/" appears as | 155 // example, the URL "http://www.yahoo.com/" appears as |
156 // "/http://www.yahoo.com" when rendered, as is, in an RTL context since | 156 // "/http://www.yahoo.com" when rendered, as is, in an RTL context since |
157 // the Unicode BiDi algorithm puts certain characters on the left by | 157 // the Unicode BiDi algorithm puts certain characters on the left by |
158 // default. | 158 // default. |
159 std::wstring elided_url(gfx::ElideUrl(url, tt_font, max_width, languages)); | 159 std::wstring elided_url(gfx::ElideUrl(url, tt_font, max_width, languages)); |
160 base::i18n::GetDisplayStringInLTRDirectionality(&elided_url); | 160 elided_url = UTF16ToWide(base::i18n::GetDisplayStringInLTRDirectionality( |
| 161 WideToUTF16(elided_url))); |
161 result.append(elided_url); | 162 result.append(elided_url); |
162 } | 163 } |
163 return result; | 164 return result; |
164 } | 165 } |
165 | 166 |
166 // BookmarkButton ------------------------------------------------------------- | 167 // BookmarkButton ------------------------------------------------------------- |
167 | 168 |
168 // Buttons used for the bookmarks on the bookmark bar. | 169 // Buttons used for the bookmarks on the bookmark bar. |
169 | 170 |
170 class BookmarkButton : public views::TextButton { | 171 class BookmarkButton : public views::TextButton { |
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1709 // The tooltip is the only way we have to display text explaining the error | 1710 // The tooltip is the only way we have to display text explaining the error |
1710 // to the user. | 1711 // to the user. |
1711 sync_error_button->SetTooltipText( | 1712 sync_error_button->SetTooltipText( |
1712 l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); | 1713 l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); |
1713 sync_error_button->SetAccessibleName( | 1714 sync_error_button->SetAccessibleName( |
1714 l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); | 1715 l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); |
1715 sync_error_button->SetIcon( | 1716 sync_error_button->SetIcon( |
1716 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); | 1717 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); |
1717 return sync_error_button; | 1718 return sync_error_button; |
1718 } | 1719 } |
OLD | NEW |