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

Side by Side Diff: ui/views/controls/menu/menu_item_view_linux.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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 (height() - top_margin - bottom_margin - 62 (height() - top_margin - bottom_margin -
63 image->height()) / 2, 63 image->height()) / 2,
64 image->width(), 64 image->width(),
65 image->height()); 65 image->height());
66 AdjustBoundsForRTLUI(&radio_bounds); 66 AdjustBoundsForRTLUI(&radio_bounds);
67 canvas->DrawBitmapInt(*image, radio_bounds.x(), radio_bounds.y()); 67 canvas->DrawBitmapInt(*image, radio_bounds.x(), radio_bounds.y());
68 } 68 }
69 69
70 // Render the foreground. 70 // Render the foreground.
71 #if defined(OS_CHROMEOS) 71 #if defined(OS_CHROMEOS)
72 SkColor fg_color = 72 SkColor fg_color = enabled() ? SK_ColorBLACK
73 IsEnabled() ? SK_ColorBLACK : SkColorSetRGB(0x80, 0x80, 0x80); 73 : SkColorSetRGB(0x80, 0x80, 0x80);
74 #else 74 #else
75 SkColor fg_color = 75 SkColor fg_color = enabled() ? TextButton::kEnabledColor
76 IsEnabled() ? TextButton::kEnabledColor : TextButton::kDisabledColor; 76 : TextButton::kDisabledColor;
77 #endif 77 #endif
78 const gfx::Font& font = GetFont(); 78 const gfx::Font& font = GetFont();
79 int accel_width = parent_menu_item_->GetSubmenu()->max_accelerator_width(); 79 int accel_width = parent_menu_item_->GetSubmenu()->max_accelerator_width();
80 int width = this->width() - item_right_margin_ - label_start_ - accel_width; 80 int width = this->width() - item_right_margin_ - label_start_ - accel_width;
81 gfx::Rect text_bounds(label_start_, top_margin + 81 gfx::Rect text_bounds(label_start_, top_margin +
82 (available_height - font.GetHeight()) / 2, width, 82 (available_height - font.GetHeight()) / 2, width,
83 font.GetHeight()); 83 font.GetHeight());
84 text_bounds.set_x(GetMirroredXForRect(text_bounds)); 84 text_bounds.set_x(GetMirroredXForRect(text_bounds));
85 canvas->DrawStringInt(title(), font, fg_color, 85 canvas->DrawStringInt(title(), font, fg_color,
86 text_bounds.x(), text_bounds.y(), text_bounds.width(), 86 text_bounds.x(), text_bounds.y(), text_bounds.width(),
(...skipping 20 matching lines...) Expand all
107 top_margin + (available_height - 107 top_margin + (available_height -
108 config.arrow_width) / 2, 108 config.arrow_width) / 2,
109 config.arrow_width, height()); 109 config.arrow_width, height());
110 AdjustBoundsForRTLUI(&arrow_bounds); 110 AdjustBoundsForRTLUI(&arrow_bounds);
111 canvas->DrawBitmapInt(*GetSubmenuArrowImage(), 111 canvas->DrawBitmapInt(*GetSubmenuArrowImage(),
112 arrow_bounds.x(), arrow_bounds.y()); 112 arrow_bounds.x(), arrow_bounds.y());
113 } 113 }
114 } 114 }
115 115
116 } // namespace views 116 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_item_view_aura.cc ('k') | ui/views/controls/menu/menu_item_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698