| OLD | NEW |
| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 items += 2; | 74 items += 2; |
| 75 } | 75 } |
| 76 | 76 |
| 77 return items; | 77 return items; |
| 78 } | 78 } |
| 79 | 79 |
| 80 ui::MenuModel::ItemType BackForwardMenuModel::GetTypeAt(int index) const { | 80 ui::MenuModel::ItemType BackForwardMenuModel::GetTypeAt(int index) const { |
| 81 return IsSeparator(index) ? TYPE_SEPARATOR : TYPE_COMMAND; | 81 return IsSeparator(index) ? TYPE_SEPARATOR : TYPE_COMMAND; |
| 82 } | 82 } |
| 83 | 83 |
| 84 ui::MenuSeparatorType BackForwardMenuModel::GetSeparatorTypeAt( |
| 85 int index) const { |
| 86 return ui::NORMAL_SEPARATOR; |
| 87 } |
| 88 |
| 84 int BackForwardMenuModel::GetCommandIdAt(int index) const { | 89 int BackForwardMenuModel::GetCommandIdAt(int index) const { |
| 85 return index; | 90 return index; |
| 86 } | 91 } |
| 87 | 92 |
| 88 string16 BackForwardMenuModel::GetLabelAt(int index) const { | 93 string16 BackForwardMenuModel::GetLabelAt(int index) const { |
| 89 // Return label "Show Full History" for the last item of the menu. | 94 // Return label "Show Full History" for the last item of the menu. |
| 90 if (index == GetItemCount() - 1) | 95 if (index == GetItemCount() - 1) |
| 91 return l10n_util::GetStringUTF16(IDS_SHOWFULLHISTORY_LINK); | 96 return l10n_util::GetStringUTF16(IDS_SHOWFULLHISTORY_LINK); |
| 92 | 97 |
| 93 // Return an empty string for a separator. | 98 // Return an empty string for a separator. |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 metric_string += "ForwardMenu_"; | 475 metric_string += "ForwardMenu_"; |
| 471 else | 476 else |
| 472 metric_string += "BackMenu_"; | 477 metric_string += "BackMenu_"; |
| 473 metric_string += action; | 478 metric_string += action; |
| 474 if (index != -1) { | 479 if (index != -1) { |
| 475 // +1 is for historical reasons (indices used to start at 1). | 480 // +1 is for historical reasons (indices used to start at 1). |
| 476 metric_string += base::IntToString(index + 1); | 481 metric_string += base::IntToString(index + 1); |
| 477 } | 482 } |
| 478 return metric_string; | 483 return metric_string; |
| 479 } | 484 } |
| OLD | NEW |