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

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

Issue 2690013002: Revert of Stop MenuItemView From Directly Caching MenuController (Closed)
Patch Set: Created 3 years, 10 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/views/controls/menu/menu_item_view.h ('k') | ui/views/controls/menu/submenu_view.cc » ('j') | 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_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
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
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
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_item_view.h ('k') | ui/views/controls/menu/submenu_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698