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

Unified Diff: chrome/browser/ui/views/wrench_menu.cc

Issue 5110011: A non-GTK version of menus for touchui. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix compile for touch on chromeos 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/views/native_menu_domui.cc ('k') | views/controls/menu/menu_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/wrench_menu.cc
diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc
index 23d6f2b383838b1edf22d229fc1286ed254ce1a8..3d86f91c120b41706b9015341bbbcada1c81a8de 100644
--- a/chrome/browser/ui/views/wrench_menu.cc
+++ b/chrome/browser/ui/views/wrench_menu.cc
@@ -683,40 +683,11 @@ MenuItemView* WrenchMenu::AppendMenuItem(MenuItemView* parent,
MenuModel::ItemType menu_type,
int* next_id) {
int id = (*next_id)++;
- SkBitmap icon;
- std::wstring label;
- MenuItemView::Type type;
- switch (menu_type) {
- case MenuModel::TYPE_COMMAND:
- model->GetIconAt(index, &icon);
- type = MenuItemView::NORMAL;
- label = UTF16ToWide(model->GetLabelAt(index));
- break;
- case MenuModel::TYPE_CHECK:
- type = MenuItemView::CHECKBOX;
- label = UTF16ToWide(model->GetLabelAt(index));
- break;
- case MenuModel::TYPE_RADIO:
- type = MenuItemView::RADIO;
- label = UTF16ToWide(model->GetLabelAt(index));
- break;
- case MenuModel::TYPE_SEPARATOR:
- type = MenuItemView::SEPARATOR;
- break;
- case MenuModel::TYPE_SUBMENU:
- type = MenuItemView::SUBMENU;
- label = UTF16ToWide(model->GetLabelAt(index));
- break;
- default:
- NOTREACHED();
- type = MenuItemView::NORMAL;
- break;
- }
id_to_entry_[id].first = model;
id_to_entry_[id].second = index;
- MenuItemView* menu_item = parent->AppendMenuItemImpl(id, label, icon, type);
+ MenuItemView* menu_item = parent->AppendMenuItemFromModel(model, index, id);
if (menu_item)
menu_item->SetVisible(model->IsVisibleAt(index));
« no previous file with comments | « chrome/browser/chromeos/views/native_menu_domui.cc ('k') | views/controls/menu/menu_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698