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

Unified Diff: ui/views/controls/combobox/native_combobox_win.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: order 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
« no previous file with comments | « ui/views/controls/combobox/native_combobox_views.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..73eed422a3849fe9cda0781cdff0bcb1ffebf363 100644
--- a/ui/views/controls/combobox/native_combobox_win.cc
+++ b/ui/views/controls/combobox/native_combobox_win.cc
@@ -15,14 +15,18 @@
#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;
+
+} // namespace
+
+namespace views {
////////////////////////////////////////////////////////////////////////////////
// NativeComboboxWin, public:
@@ -44,8 +48,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 = Combobox::GetFont();
int max_width = 0;
int num_items = combobox_->model()->GetItemCount();
for (int i = 0; i < num_items; ++i) {
@@ -194,8 +197,7 @@ void NativeComboboxWin::NativeControlCreated(HWND native_control) {
// NativeComboboxWin, private:
void NativeComboboxWin::UpdateFont() {
- HFONT font = ResourceBundle::GetSharedInstance().
- GetFont(ResourceBundle::BaseFont).GetNativeFont();
+ HFONT font = Combobox::GetFont().GetNativeFont();
SendMessage(native_view(), WM_SETFONT, reinterpret_cast<WPARAM>(font), FALSE);
}
« no previous file with comments | « ui/views/controls/combobox/native_combobox_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698