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

Unified Diff: ui/views/controls/combobox/native_combobox_views.cc

Issue 9839034: views: Refactor the way we get the combo box font. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/combobox/native_combobox_views.cc
diff --git a/ui/views/controls/combobox/native_combobox_views.cc b/ui/views/controls/combobox/native_combobox_views.cc
index 95fb42890f813fcf11b535550a62fc86f324e1d7..df398fc31ed79271026b6ebcc036053ec1e38bf7 100644
--- a/ui/views/controls/combobox/native_combobox_views.cc
+++ b/ui/views/controls/combobox/native_combobox_views.cc
@@ -48,6 +48,11 @@ const SkColor kTextColor = SK_ColorBLACK;
// Define the id of the first item in the menu (since it needs to be > 0)
const int kFirstMenuItemId = 1000;
+const gfx::Font& GetFont() {
sky 2012/03/23 15:36:38 Maybe we should promote this to combobox so that b
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ return rb.GetFont(ui::ResourceBundle::BaseFont);
+}
+
} // namespace
namespace views {
@@ -160,7 +165,7 @@ void NativeComboboxViews::OnBlur() {
void NativeComboboxViews::UpdateFromModel() {
int max_width = 0;
- const gfx::Font &font = GetFont();
+ const gfx::Font& font = GetFont();
MenuItemView* menu = new MenuItemView(this);
// MenuRunner owns |menu|.
@@ -268,11 +273,6 @@ bool NativeComboboxViews::GetAccelerator(int id, ui::Accelerator* accel) {
/////////////////////////////////////////////////////////////////
// NativeComboboxViews private methods:
-const gfx::Font& NativeComboboxViews::GetFont() const {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- return rb.GetFont(ResourceBundle::BaseFont);
-}
-
void NativeComboboxViews::AdjustBoundsForRTLUI(gfx::Rect* rect) const {
rect->set_x(GetMirroredXForRect(*rect));
}
« no previous file with comments | « ui/views/controls/combobox/native_combobox_views.h ('k') | ui/views/controls/combobox/native_combobox_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698