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

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

Issue 1454583002: Change Views menus to consistently use GetNativeTheme for theming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get menu config from item Created 5 years, 1 month 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
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 "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
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
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
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_controller_unittest.cc ('k') | ui/views/controls/menu/menu_runner_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698