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

Unified Diff: ui/views/controls/menu/menu_item_view.cc

Issue 23530070: backup for dynamic recent tabs submenu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: new RecentTabsMenuModelDelegate w/ new intf Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/menu/menu_item_view.h ('k') | ui/views/controls/menu/menu_model_adapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_item_view.cc
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
index 040cd898616e2c8993299abe6b005721ad1391e7..1e526f1647482bbbcbf359b3d9eb87c2db7708bf 100644
--- a/ui/views/controls/menu/menu_item_view.cc
+++ b/ui/views/controls/menu/menu_item_view.cc
@@ -311,60 +311,6 @@ MenuItemView* MenuItemView::AppendMenuItemWithIcon(int item_id,
NORMAL, ui::NORMAL_SEPARATOR);
}
-MenuItemView* MenuItemView::AppendMenuItemFromModel(ui::MenuModel* model,
- int index,
- int id) {
- gfx::Image icon;
- model->GetIconAt(index, &icon);
- string16 label, sublabel, minor_text;
- ui::MenuSeparatorType separator_style = ui::NORMAL_SEPARATOR;
- MenuItemView::Type type;
- ui::MenuModel::ItemType menu_type = model->GetTypeAt(index);
- switch (menu_type) {
- case ui::MenuModel::TYPE_COMMAND:
- type = MenuItemView::NORMAL;
- label = model->GetLabelAt(index);
- sublabel = model->GetSublabelAt(index);
- minor_text = model->GetMinorTextAt(index);
- break;
- case ui::MenuModel::TYPE_CHECK:
- type = MenuItemView::CHECKBOX;
- label = model->GetLabelAt(index);
- sublabel = model->GetSublabelAt(index);
- minor_text = model->GetMinorTextAt(index);
- break;
- case ui::MenuModel::TYPE_RADIO:
- type = MenuItemView::RADIO;
- label = model->GetLabelAt(index);
- sublabel = model->GetSublabelAt(index);
- minor_text = model->GetMinorTextAt(index);
- break;
- case ui::MenuModel::TYPE_SEPARATOR:
- icon = gfx::Image();
- type = MenuItemView::SEPARATOR;
- separator_style = model->GetSeparatorTypeAt(index);
- break;
- case ui::MenuModel::TYPE_SUBMENU:
- type = MenuItemView::SUBMENU;
- label = model->GetLabelAt(index);
- sublabel = model->GetSublabelAt(index);
- minor_text = model->GetMinorTextAt(index);
- break;
- default:
- NOTREACHED();
- type = MenuItemView::NORMAL;
- break;
- }
-
- return AppendMenuItemImpl(id,
- label,
- sublabel,
- minor_text,
- icon.IsEmpty() ? gfx::ImageSkia() : *icon.ToImageSkia(),
- type,
- separator_style);
-}
-
MenuItemView* MenuItemView::AppendMenuItemImpl(
int item_id,
const string16& label,
« no previous file with comments | « ui/views/controls/menu/menu_item_view.h ('k') | ui/views/controls/menu/menu_model_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698