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

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

Issue 10837317: Setting the touch wrench menu as default menu for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And another merge! Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 items += 2; 75 items += 2;
76 } 76 }
77 77
78 return items; 78 return items;
79 } 79 }
80 80
81 ui::MenuModel::ItemType BackForwardMenuModel::GetTypeAt(int index) const { 81 ui::MenuModel::ItemType BackForwardMenuModel::GetTypeAt(int index) const {
82 return IsSeparator(index) ? TYPE_SEPARATOR : TYPE_COMMAND; 82 return IsSeparator(index) ? TYPE_SEPARATOR : TYPE_COMMAND;
83 } 83 }
84 84
85 ui::MenuSeparatorType BackForwardMenuModel::GetSeparatorTypeAt(
86 int index) const {
87 return ui::NORMAL_SEPARATOR;
88 }
89
85 int BackForwardMenuModel::GetCommandIdAt(int index) const { 90 int BackForwardMenuModel::GetCommandIdAt(int index) const {
86 return index; 91 return index;
87 } 92 }
88 93
89 string16 BackForwardMenuModel::GetLabelAt(int index) const { 94 string16 BackForwardMenuModel::GetLabelAt(int index) const {
90 // Return label "Show Full History" for the last item of the menu. 95 // Return label "Show Full History" for the last item of the menu.
91 if (index == GetItemCount() - 1) 96 if (index == GetItemCount() - 1)
92 return l10n_util::GetStringUTF16(IDS_SHOWFULLHISTORY_LINK); 97 return l10n_util::GetStringUTF16(IDS_SHOWFULLHISTORY_LINK);
93 98
94 // Return an empty string for a separator. 99 // Return an empty string for a separator.
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 metric_string += "ForwardMenu_"; 472 metric_string += "ForwardMenu_";
468 else 473 else
469 metric_string += "BackMenu_"; 474 metric_string += "BackMenu_";
470 metric_string += action; 475 metric_string += action;
471 if (index != -1) { 476 if (index != -1) {
472 // +1 is for historical reasons (indices used to start at 1). 477 // +1 is for historical reasons (indices used to start at 1).
473 metric_string += base::IntToString(index + 1); 478 metric_string += base::IntToString(index + 1);
474 } 479 }
475 return metric_string; 480 return metric_string;
476 } 481 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/back_forward_menu_model.h ('k') | chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698