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

Unified Diff: views/controls/button/native_button.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « views/controls/button/checkbox.cc ('k') | views/controls/button/native_button_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/button/native_button.cc
===================================================================
--- views/controls/button/native_button.cc (revision 55911)
+++ views/controls/button/native_button.cc (working copy)
@@ -4,16 +4,19 @@
#include "views/controls/button/native_button.h"
-#if defined(OS_LINUX)
-#include <gdk/gdkkeysyms.h>
-#include "views/screen.h"
-#endif
-
#include "base/i18n/rtl.h"
#include "base/keyboard_codes.h"
#include "base/logging.h"
#include "views/controls/native/native_view_host.h"
+#if defined(OS_WIN)
+#include "gfx/platform_font_win.h"
+#elif defined(OS_LINUX)
+#include <gdk/gdkkeysyms.h>
+#include "views/screen.h"
+#endif
+
+
namespace views {
#if defined(OS_WIN)
@@ -144,10 +147,14 @@
#if defined(OS_WIN)
// Clamp the size returned to at least the minimum size.
if (!ignore_minimum_size_) {
- sz.set_width(std::max(sz.width(),
- font_.horizontal_dlus_to_pixels(kMinWidthDLUs)));
- sz.set_height(std::max(sz.height(),
- font_.vertical_dlus_to_pixels(kMinHeightDLUs)));
+ gfx::PlatformFontWin* platform_font =
+ static_cast<gfx::PlatformFontWin*>(font_.platform_font());
+ sz.set_width(std::max(
+ sz.width(),
+ platform_font->horizontal_dlus_to_pixels(kMinWidthDLUs)));
+ sz.set_height(std::max(
+ sz.height(),
+ platform_font->vertical_dlus_to_pixels(kMinHeightDLUs)));
}
// GTK returns a meaningful preferred size so that we don't need to adjust
// the preferred size as we do on windows.
« no previous file with comments | « views/controls/button/checkbox.cc ('k') | views/controls/button/native_button_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698