Index: ui/views/controls/combobox/native_combobox_win.cc |
diff --git a/ui/views/controls/combobox/native_combobox_win.cc b/ui/views/controls/combobox/native_combobox_win.cc |
index 7b0fca4d371d07a3b171b9a1bef9e2d7c5c59b78..94260747e305e3563855895d7b1ee5d49e7bdaf9 100644 |
--- a/ui/views/controls/combobox/native_combobox_win.cc |
+++ b/ui/views/controls/combobox/native_combobox_win.cc |
@@ -15,14 +15,23 @@ |
#include "ui/views/controls/combobox/native_combobox_views.h" |
#include "ui/views/widget/widget.h" |
-namespace views { |
+namespace { |
// Limit how small a combobox can be. |
-static const int kMinComboboxWidth = 148; |
+const int kMinComboboxWidth = 148; |
// Add a couple extra pixels to the widths of comboboxes and combobox |
// dropdowns so that text isn't too crowded. |
-static const int kComboboxExtraPaddingX = 6; |
+const int kComboboxExtraPaddingX = 6; |
+ |
+const gfx::Font& GetFont() { |
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
+ return rb.GetFont(ui::ResourceBundle::BaseFont); |
+} |
+ |
+} // namespace |
+ |
+namespace views { |
//////////////////////////////////////////////////////////////////////////////// |
// NativeComboboxWin, public: |
@@ -44,8 +53,7 @@ NativeComboboxWin::~NativeComboboxWin() { |
void NativeComboboxWin::UpdateFromModel() { |
SendMessage(native_view(), CB_RESETCONTENT, 0, 0); |
- gfx::Font font = ResourceBundle::GetSharedInstance().GetFont( |
- ResourceBundle::BaseFont); |
+ const gfx::Font& font = GetFont(); |
int max_width = 0; |
int num_items = combobox_->model()->GetItemCount(); |
for (int i = 0; i < num_items; ++i) { |
@@ -194,8 +202,7 @@ void NativeComboboxWin::NativeControlCreated(HWND native_control) { |
// NativeComboboxWin, private: |
void NativeComboboxWin::UpdateFont() { |
- HFONT font = ResourceBundle::GetSharedInstance(). |
- GetFont(ResourceBundle::BaseFont).GetNativeFont(); |
+ HFONT font = GetFont().GetNativeFont(); |
SendMessage(native_view(), WM_SETFONT, reinterpret_cast<WPARAM>(font), FALSE); |
} |