OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/back_forward_menu_model.h" | 7 #include "chrome/browser/back_forward_menu_model.h" |
8 | 8 |
9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
10 #include "chrome/browser/metrics/user_metrics.h" | 10 #include "chrome/browser/metrics/user_metrics.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 std::wstring BackForwardMenuModel::GetItemLabel(int menu_id) const { | 215 std::wstring BackForwardMenuModel::GetItemLabel(int menu_id) const { |
216 // Return label "Show Full History" for the last item of the menu. | 216 // Return label "Show Full History" for the last item of the menu. |
217 if (menu_id == GetTotalItemCount()) | 217 if (menu_id == GetTotalItemCount()) |
218 return l10n_util::GetString(IDS_SHOWFULLHISTORY_LINK); | 218 return l10n_util::GetString(IDS_SHOWFULLHISTORY_LINK); |
219 | 219 |
220 // Return an empty string for a separator. | 220 // Return an empty string for a separator. |
221 if (IsSeparator(menu_id)) | 221 if (IsSeparator(menu_id)) |
222 return L""; | 222 return L""; |
223 | 223 |
224 NavigationEntry* entry = GetNavigationEntry(menu_id); | 224 NavigationEntry* entry = GetNavigationEntry(menu_id); |
225 return UTF16ToWideHack(entry->title()); | 225 return UTF16ToWideHack(entry->GetTitleForDisplay(NULL)); |
226 } | 226 } |
227 | 227 |
228 const SkBitmap& BackForwardMenuModel::GetItemIcon(int menu_id) const { | 228 const SkBitmap& BackForwardMenuModel::GetItemIcon(int menu_id) const { |
229 DCHECK(ItemHasIcon(menu_id)); | 229 DCHECK(ItemHasIcon(menu_id)); |
230 | 230 |
231 NavigationEntry* entry = GetNavigationEntry(menu_id); | 231 NavigationEntry* entry = GetNavigationEntry(menu_id); |
232 return entry->favicon().bitmap(); | 232 return entry->favicon().bitmap(); |
233 } | 233 } |
234 | 234 |
235 bool BackForwardMenuModel::ItemHasIcon(int menu_id) const { | 235 bool BackForwardMenuModel::ItemHasIcon(int menu_id) const { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 std::wstring metric_string; | 300 std::wstring metric_string; |
301 if (model_type_ == FORWARD_MENU_DELEGATE) | 301 if (model_type_ == FORWARD_MENU_DELEGATE) |
302 metric_string += L"ForwardMenu_"; | 302 metric_string += L"ForwardMenu_"; |
303 else | 303 else |
304 metric_string += L"BackMenu_"; | 304 metric_string += L"BackMenu_"; |
305 metric_string += action; | 305 metric_string += action; |
306 if (index != -1) | 306 if (index != -1) |
307 metric_string += IntToWString(index); | 307 metric_string += IntToWString(index); |
308 return metric_string; | 308 return metric_string; |
309 } | 309 } |
OLD | NEW |