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

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

Issue 8909002: views: Convert IsEnabled() to just enabled() since it's just a simple accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "third_party/skia/include/effects/SkGradientShader.h" 9 #include "third_party/skia/include/effects/SkGradientShader.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 top_margin + 57 top_margin +
58 (height() - top_margin - bottom_margin - 58 (height() - top_margin - bottom_margin -
59 image->height()) / 2, 59 image->height()) / 2,
60 image->width(), 60 image->width(),
61 image->height()); 61 image->height());
62 AdjustBoundsForRTLUI(&radio_bounds); 62 AdjustBoundsForRTLUI(&radio_bounds);
63 canvas->DrawBitmapInt(*image, radio_bounds.x(), radio_bounds.y()); 63 canvas->DrawBitmapInt(*image, radio_bounds.x(), radio_bounds.y());
64 } 64 }
65 65
66 // Render the foreground. 66 // Render the foreground.
67 SkColor fg_color = 67 SkColor fg_color = enabled() ? TextButton::kEnabledColor
68 IsEnabled() ? TextButton::kEnabledColor : TextButton::kDisabledColor; 68 : TextButton::kDisabledColor;
69 const gfx::Font& font = GetFont(); 69 const gfx::Font& font = GetFont();
70 int accel_width = parent_menu_item_->GetSubmenu()->max_accelerator_width(); 70 int accel_width = parent_menu_item_->GetSubmenu()->max_accelerator_width();
71 int width = this->width() - item_right_margin_ - label_start_ - accel_width; 71 int width = this->width() - item_right_margin_ - label_start_ - accel_width;
72 gfx::Rect text_bounds(label_start_, top_margin + 72 gfx::Rect text_bounds(label_start_, top_margin +
73 (available_height - font.GetHeight()) / 2, width, 73 (available_height - font.GetHeight()) / 2, width,
74 font.GetHeight()); 74 font.GetHeight());
75 text_bounds.set_x(GetMirroredXForRect(text_bounds)); 75 text_bounds.set_x(GetMirroredXForRect(text_bounds));
76 canvas->DrawStringInt(title(), font, fg_color, 76 canvas->DrawStringInt(title(), font, fg_color,
77 text_bounds.x(), text_bounds.y(), text_bounds.width(), 77 text_bounds.x(), text_bounds.y(), text_bounds.width(),
78 text_bounds.height(), 78 text_bounds.height(),
(...skipping 19 matching lines...) Expand all
98 top_margin + (available_height - 98 top_margin + (available_height -
99 config.arrow_width) / 2, 99 config.arrow_width) / 2,
100 config.arrow_width, height()); 100 config.arrow_width, height());
101 AdjustBoundsForRTLUI(&arrow_bounds); 101 AdjustBoundsForRTLUI(&arrow_bounds);
102 canvas->DrawBitmapInt(*GetSubmenuArrowImage(), 102 canvas->DrawBitmapInt(*GetSubmenuArrowImage(),
103 arrow_bounds.x(), arrow_bounds.y()); 103 arrow_bounds.x(), arrow_bounds.y());
104 } 104 }
105 } 105 }
106 106
107 } // namespace views 107 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/controls/menu/menu_item_view_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698