| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 } | 428 } |
| 429 | 429 |
| 430 const MenuItemView::MenuItemDimensions& MenuItemView::GetDimensions() const { | 430 const MenuItemView::MenuItemDimensions& MenuItemView::GetDimensions() const { |
| 431 if (!is_dimensions_valid()) | 431 if (!is_dimensions_valid()) |
| 432 dimensions_ = CalculateDimensions(); | 432 dimensions_ = CalculateDimensions(); |
| 433 DCHECK(is_dimensions_valid()); | 433 DCHECK(is_dimensions_valid()); |
| 434 return dimensions_; | 434 return dimensions_; |
| 435 } | 435 } |
| 436 | 436 |
| 437 MenuController* MenuItemView::GetMenuController() { | 437 MenuController* MenuItemView::GetMenuController() { |
| 438 return GetRootMenuItem()->controller_.get(); | 438 return GetRootMenuItem()->controller_; |
| 439 } | 439 } |
| 440 | 440 |
| 441 const MenuController* MenuItemView::GetMenuController() const { | 441 const MenuController* MenuItemView::GetMenuController() const { |
| 442 return GetRootMenuItem()->controller_.get(); | 442 return GetRootMenuItem()->controller_; |
| 443 } | 443 } |
| 444 | 444 |
| 445 MenuDelegate* MenuItemView::GetDelegate() { | 445 MenuDelegate* MenuItemView::GetDelegate() { |
| 446 return GetRootMenuItem()->delegate_; | 446 return GetRootMenuItem()->delegate_; |
| 447 } | 447 } |
| 448 | 448 |
| 449 const MenuDelegate* MenuItemView::GetDelegate() const { | 449 const MenuDelegate* MenuItemView::GetDelegate() const { |
| 450 return GetRootMenuItem()->delegate_; | 450 return GetRootMenuItem()->delegate_; |
| 451 } | 451 } |
| 452 | 452 |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 } else { | 1067 } else { |
| 1068 const Type& type = menu_item->GetType(); | 1068 const Type& type = menu_item->GetType(); |
| 1069 if (type == CHECKBOX || type == RADIO) | 1069 if (type == CHECKBOX || type == RADIO) |
| 1070 return true; | 1070 return true; |
| 1071 } | 1071 } |
| 1072 } | 1072 } |
| 1073 return false; | 1073 return false; |
| 1074 } | 1074 } |
| 1075 | 1075 |
| 1076 } // namespace views | 1076 } // namespace views |
| OLD | NEW |