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

Side by Side Diff: chrome/browser/back_forward_menu_model.cc

Issue 57013: Display a title for files in the back/forward menu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698