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

Side by Side Diff: ui/views/controls/menu/menu_model_adapter.cc

Issue 1003853004: MacViews: Gets wrench menu working (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@grd
Patch Set: Created 5 years, 9 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
« no previous file with comments | « ui/base/models/button_menu_item_model.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/menu/menu_model_adapter.h" 5 #include "ui/views/controls/menu/menu_model_adapter.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/models/menu_model.h" 8 #include "ui/base/models/menu_model.h"
9 #include "ui/gfx/image/image.h" 9 #include "ui/gfx/image/image.h"
10 #include "ui/views/controls/menu/menu_item_view.h" 10 #include "ui/views/controls/menu/menu_item_view.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 int item_id) { 59 int item_id) {
60 gfx::Image icon; 60 gfx::Image icon;
61 model->GetIconAt(model_index, &icon); 61 model->GetIconAt(model_index, &icon);
62 base::string16 label, sublabel, minor_text; 62 base::string16 label, sublabel, minor_text;
63 ui::MenuSeparatorType separator_style = ui::NORMAL_SEPARATOR; 63 ui::MenuSeparatorType separator_style = ui::NORMAL_SEPARATOR;
64 MenuItemView::Type type; 64 MenuItemView::Type type;
65 ui::MenuModel::ItemType menu_type = model->GetTypeAt(model_index); 65 ui::MenuModel::ItemType menu_type = model->GetTypeAt(model_index);
66 66
67 switch (menu_type) { 67 switch (menu_type) {
68 case ui::MenuModel::TYPE_COMMAND: 68 case ui::MenuModel::TYPE_COMMAND:
69 case ui::MenuModel::TYPE_BUTTON_ITEM:
69 type = MenuItemView::NORMAL; 70 type = MenuItemView::NORMAL;
70 label = model->GetLabelAt(model_index); 71 label = model->GetLabelAt(model_index);
71 sublabel = model->GetSublabelAt(model_index); 72 sublabel = model->GetSublabelAt(model_index);
72 minor_text = model->GetMinorTextAt(model_index); 73 minor_text = model->GetMinorTextAt(model_index);
73 break; 74 break;
74 case ui::MenuModel::TYPE_CHECK: 75 case ui::MenuModel::TYPE_CHECK:
75 type = MenuItemView::CHECKBOX; 76 type = MenuItemView::CHECKBOX;
76 label = model->GetLabelAt(model_index); 77 label = model->GetLabelAt(model_index);
77 sublabel = model->GetSublabelAt(model_index); 78 sublabel = model->GetSublabelAt(model_index);
78 minor_text = model->GetMinorTextAt(model_index); 79 minor_text = model->GetMinorTextAt(model_index);
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 has_icons = has_icons || item->has_icons(); 284 has_icons = has_icons || item->has_icons();
284 285
285 menu_map_[item] = submodel; 286 menu_map_[item] = submodel;
286 } 287 }
287 } 288 }
288 289
289 menu->set_has_icons(has_icons); 290 menu->set_has_icons(has_icons);
290 } 291 }
291 292
292 } // namespace views 293 } // namespace views
OLDNEW
« no previous file with comments | « ui/base/models/button_menu_item_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698