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

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

Issue 5697005: Change SimpleMenuModel on OSX to support dynamic icons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update after merge Created 10 years 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
OLDNEW
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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" 7 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h"
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/text_elider.h" 10 #include "app/text_elider.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 &GetTabContents()->controller())); 80 &GetTabContents()->controller()));
81 menu_text = gfx::ElideText(menu_text, gfx::Font(), kMaxWidth, false); 81 menu_text = gfx::ElideText(menu_text, gfx::Font(), kMaxWidth, false);
82 82
83 for (size_t i = menu_text.find('&'); i != string16::npos; 83 for (size_t i = menu_text.find('&'); i != string16::npos;
84 i = menu_text.find('&', i + 2)) { 84 i = menu_text.find('&', i + 2)) {
85 menu_text.insert(i, 1, '&'); 85 menu_text.insert(i, 1, '&');
86 } 86 }
87 return menu_text; 87 return menu_text;
88 } 88 }
89 89
90 bool BackForwardMenuModel::IsLabelDynamicAt(int index) const { 90 bool BackForwardMenuModel::IsItemDynamicAt(int index) const {
91 // This object is only used for a single showing of a menu. 91 // This object is only used for a single showing of a menu.
92 return false; 92 return false;
93 } 93 }
94 94
95 bool BackForwardMenuModel::GetAcceleratorAt( 95 bool BackForwardMenuModel::GetAcceleratorAt(
96 int index, 96 int index,
97 menus::Accelerator* accelerator) const { 97 menus::Accelerator* accelerator) const {
98 return false; 98 return false;
99 } 99 }
100 100
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 metric_string += "ForwardMenu_"; 370 metric_string += "ForwardMenu_";
371 else 371 else
372 metric_string += "BackMenu_"; 372 metric_string += "BackMenu_";
373 metric_string += action; 373 metric_string += action;
374 if (index != -1) { 374 if (index != -1) {
375 // +1 is for historical reasons (indices used to start at 1). 375 // +1 is for historical reasons (indices used to start at 1).
376 metric_string += base::IntToString(index + 1); 376 metric_string += base::IntToString(index + 1);
377 } 377 }
378 return metric_string; 378 return metric_string;
379 } 379 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/back_forward_menu_model.h ('k') | chrome/browser/ui/toolbar/wrench_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698