| 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 "ui/views/controls/menu/menu_item_view.h" | 5 #include "ui/views/controls/menu/menu_item_view.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 } | 561 } |
| 562 | 562 |
| 563 void MenuItemView::SetMargins(int top_margin, int bottom_margin) { | 563 void MenuItemView::SetMargins(int top_margin, int bottom_margin) { |
| 564 top_margin_ = top_margin; | 564 top_margin_ = top_margin; |
| 565 bottom_margin_ = bottom_margin; | 565 bottom_margin_ = bottom_margin; |
| 566 | 566 |
| 567 invalidate_dimensions(); | 567 invalidate_dimensions(); |
| 568 } | 568 } |
| 569 | 569 |
| 570 const MenuConfig& MenuItemView::GetMenuConfig() const { | 570 const MenuConfig& MenuItemView::GetMenuConfig() const { |
| 571 const MenuController* controller = GetMenuController(); | 571 return MenuConfig::instance(GetNativeTheme()); |
| 572 if (controller) | |
| 573 return controller->menu_config_; | |
| 574 return MenuConfig::instance(NULL); | |
| 575 } | 572 } |
| 576 | 573 |
| 577 MenuItemView::MenuItemView(MenuItemView* parent, | 574 MenuItemView::MenuItemView(MenuItemView* parent, |
| 578 int command, | 575 int command, |
| 579 MenuItemView::Type type) | 576 MenuItemView::Type type) |
| 580 : delegate_(NULL), | 577 : delegate_(NULL), |
| 581 controller_(NULL), | 578 controller_(NULL), |
| 582 canceled_(false), | 579 canceled_(false), |
| 583 parent_menu_item_(parent), | 580 parent_menu_item_(parent), |
| 584 type_(type), | 581 type_(type), |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 } else { | 1071 } else { |
| 1075 const Type& type = menu_item->GetType(); | 1072 const Type& type = menu_item->GetType(); |
| 1076 if (type == CHECKBOX || type == RADIO) | 1073 if (type == CHECKBOX || type == RADIO) |
| 1077 return true; | 1074 return true; |
| 1078 } | 1075 } |
| 1079 } | 1076 } |
| 1080 return false; | 1077 return false; |
| 1081 } | 1078 } |
| 1082 | 1079 |
| 1083 } // namespace views | 1080 } // namespace views |
| OLD | NEW |