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 "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 | 81 |
82 // static | 82 // static |
83 int MenuItemView::item_right_margin_; | 83 int MenuItemView::item_right_margin_; |
84 | 84 |
85 // static | 85 // static |
86 int MenuItemView::pref_menu_height_; | 86 int MenuItemView::pref_menu_height_; |
87 | 87 |
88 // static | 88 // static |
89 const char MenuItemView::kViewClassName[] = "MenuItemView"; | 89 const char MenuItemView::kViewClassName[] = "MenuItemView"; |
90 | 90 |
91 // Note: This class also has a protected constructor and a common Init function | |
92 // to initialize both. | |
91 MenuItemView::MenuItemView(MenuDelegate* delegate) | 93 MenuItemView::MenuItemView(MenuDelegate* delegate) |
92 : delegate_(delegate), | 94 : delegate_(delegate), |
93 controller_(NULL), | 95 controller_(NULL), |
94 canceled_(false), | 96 canceled_(false), |
95 parent_menu_item_(NULL), | 97 parent_menu_item_(NULL), |
96 type_(SUBMENU), | 98 type_(SUBMENU), |
97 selected_(false), | 99 selected_(false), |
98 command_(0), | 100 command_(0), |
99 submenu_(NULL), | 101 submenu_(NULL), |
100 has_mnemonics_(false), | 102 has_mnemonics_(false), |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
552 invalidate_dimensions(); | 554 invalidate_dimensions(); |
553 } | 555 } |
554 | 556 |
555 const MenuConfig& MenuItemView::GetMenuConfig() const { | 557 const MenuConfig& MenuItemView::GetMenuConfig() const { |
556 const MenuController* controller = GetMenuController(); | 558 const MenuController* controller = GetMenuController(); |
557 if (controller) | 559 if (controller) |
558 return controller->menu_config_; | 560 return controller->menu_config_; |
559 return MenuConfig::instance(NULL); | 561 return MenuConfig::instance(NULL); |
560 } | 562 } |
561 | 563 |
564 // Note: This class also has a public constructor and a common Init function | |
sky
2014/02/19 15:01:19
These comments aren't helpful, nuke them.
| |
565 // to initialize both. | |
562 MenuItemView::MenuItemView(MenuItemView* parent, | 566 MenuItemView::MenuItemView(MenuItemView* parent, |
563 int command, | 567 int command, |
564 MenuItemView::Type type) | 568 MenuItemView::Type type) |
565 : delegate_(NULL), | 569 : delegate_(NULL), |
566 controller_(NULL), | 570 controller_(NULL), |
567 canceled_(false), | 571 canceled_(false), |
568 parent_menu_item_(parent), | 572 parent_menu_item_(parent), |
569 type_(type), | 573 type_(type), |
570 selected_(false), | 574 selected_(false), |
571 command_(command), | 575 command_(command), |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1060 } else { | 1064 } else { |
1061 const Type& type = menu_item->GetType(); | 1065 const Type& type = menu_item->GetType(); |
1062 if (type == CHECKBOX || type == RADIO) | 1066 if (type == CHECKBOX || type == RADIO) |
1063 return true; | 1067 return true; |
1064 } | 1068 } |
1065 } | 1069 } |
1066 return false; | 1070 return false; |
1067 } | 1071 } |
1068 | 1072 |
1069 } // namespace views | 1073 } // namespace views |
OLD | NEW |