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

Unified Diff: chrome/browser/views/constrained_window_impl.cc

Issue 62064: UI font localization part 2 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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: chrome/browser/views/constrained_window_impl.cc
===================================================================
--- chrome/browser/views/constrained_window_impl.cc (revision 13518)
+++ chrome/browser/views/constrained_window_impl.cc (working copy)
@@ -267,12 +267,12 @@
static void InitClass();
// The font to be used to render the titlebar text.
- static ChromeFont title_font_;
+ static ChromeFont* title_font_;
DISALLOW_EVIL_CONSTRUCTORS(ConstrainedWindowFrameView);
};
-ChromeFont ConstrainedWindowFrameView::title_font_;
+ChromeFont* ConstrainedWindowFrameView::title_font_ = NULL;
namespace {
// The frame border is only visible in restored mode and is hardcoded to 4 px on
@@ -461,7 +461,7 @@
// The bottom spacing should be the same apparent height as the top spacing,
// plus have the client edge tacked on.
int title_bottom_spacing = *title_top_spacing + kClientEdgeThickness;
- *title_thickness = std::max(title_font_.height(),
+ *title_thickness = std::max(title_font_->height(),
min_titlebar_height - *title_top_spacing - title_bottom_spacing);
return *title_top_spacing + *title_thickness + title_bottom_spacing;
}
@@ -511,7 +511,7 @@
}
void ConstrainedWindowFrameView::PaintTitleBar(ChromeCanvas* canvas) {
- canvas->DrawStringInt(container_->GetWindowTitle(), title_font_,
+ canvas->DrawStringInt(container_->GetWindowTitle(), *title_font_,
GetTitleColor(), MirroredLeftPointForRect(title_bounds_),
title_bounds_.y(), title_bounds_.width(), title_bounds_.height());
}
@@ -545,9 +545,9 @@
int title_top_spacing, title_thickness;
TitleCoordinates(&title_top_spacing, &title_thickness);
title_bounds_.SetRect(title_x,
- title_top_spacing + ((title_thickness - title_font_.height()) / 2),
+ title_top_spacing + ((title_thickness - title_font_->height()) / 2),
std::max(0, close_button_->x() - kTitleCaptionSpacing - title_x),
- title_font_.height());
+ title_font_->height());
}
void ConstrainedWindowFrameView::LayoutClientView() {
@@ -580,7 +580,7 @@
void ConstrainedWindowFrameView::InitClass() {
static bool initialized = false;
if (!initialized) {
- title_font_ = win_util::GetWindowTitleFont();
+ title_font_ = new ChromeFont(win_util::GetWindowTitleFont());
initialized = true;
}
« no previous file with comments | « chrome/app/resources/locale_settings_zh-TW.xtb ('k') | chrome/browser/views/frame/opaque_browser_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698