summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 02:16:10 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 02:16:10 +0000
commit7322c44018c4e7b8bd58c67f52986660fb365d76 (patch)
tree4bb67ec23689e83682a5aa228e3b8c402880baa8 /chrome/browser/autocomplete
parent0c875075a6c45e9979b8345e5f5f9d4b747e05c3 (diff)
downloadchromium_src-7322c44018c4e7b8bd58c67f52986660fb365d76.zip
chromium_src-7322c44018c4e7b8bd58c67f52986660fb365d76.tar.gz
chromium_src-7322c44018c4e7b8bd58c67f52986660fb365d76.tar.bz2
ChromeFont->gfx::Font
Does not rename the files yet. http://crbug.com/11387 Review URL: http://codereview.chromium.org/113441 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16141 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.cc2
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.h4
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view.h4
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc18
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_win.cc8
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_win.h8
6 files changed, 22 insertions, 22 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
index 35bd86b..1dabca1 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
@@ -390,7 +390,7 @@ base::LazyInstance<PaintPatcher> g_paint_patcher(base::LINKER_INITIALIZED);
} // namespace
AutocompleteEditViewWin::AutocompleteEditViewWin(
- const ChromeFont& font,
+ const gfx::Font& font,
AutocompleteEditController* controller,
ToolbarModel* toolbar_model,
views::View* parent_view,
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.h b/chrome/browser/autocomplete/autocomplete_edit_view_win.h
index 7b00044..053adcd 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.h
@@ -60,7 +60,7 @@ class AutocompleteEditViewWin
DECLARE_WND_CLASS(L"Chrome_AutocompleteEditView");
- AutocompleteEditViewWin(const ChromeFont& font,
+ AutocompleteEditViewWin(const gfx::Font& font,
AutocompleteEditController* controller,
ToolbarModel* toolbar_model,
views::View* parent_view,
@@ -428,7 +428,7 @@ class AutocompleteEditViewWin
// Font we're using. We keep a reference to make sure the font supplied to
// the constructor doesn't go away before we do.
- ChromeFont font_;
+ gfx::Font font_;
// Metrics about the font, which we keep so we don't need to recalculate them
// every time we paint. |font_y_adjustment_| is the number of pixels we need
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view.h b/chrome/browser/autocomplete/autocomplete_popup_view.h
index c532847..f287d63 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view.h
+++ b/chrome/browser/autocomplete/autocomplete_popup_view.h
@@ -13,8 +13,8 @@
class AutocompleteEditView;
class AutocompletePopupModel;
-class ChromeFont;
namespace gfx {
+class Font;
class Rect;
}
#if defined(OS_WIN)
@@ -60,7 +60,7 @@ class AutocompletePopupView {
// Create a popup view implementation. It may make sense for this to become
// platform independent eventually.
static AutocompletePopupView* CreatePopupView(
- const ChromeFont& font,
+ const gfx::Font& font,
AutocompleteEditViewWin* edit_view,
AutocompleteEditModel* edit_model,
Profile* profile,
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
index a671e40..5301f68 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
@@ -60,25 +60,25 @@ const int kRightPadding = 3;
// the total width.
const float kContentWidthPercentage = 0.7;
-// TODO(deanm): We should put this on ChromeFont so it can be shared.
+// TODO(deanm): We should put this on gfx::Font so it can be shared.
// Returns a new pango font, free with pango_font_description_free().
-PangoFontDescription* PangoFontFromChromeFont(const ChromeFont& chrome_font) {
- ChromeFont font = chrome_font; // Copy so we can call non-const methods.
+PangoFontDescription* PangoFontFromGfxFont(const gfx::Font& chrome_font) {
+ gfx::Font font = chrome_font; // Copy so we can call non-const methods.
PangoFontDescription* pfd = pango_font_description_new();
pango_font_description_set_family(pfd, WideToUTF8(font.FontName()).c_str());
pango_font_description_set_size(pfd, font.FontSize() * PANGO_SCALE);
switch (font.style()) {
- case ChromeFont::NORMAL:
+ case gfx::Font::NORMAL:
// Nothing to do, should already be PANGO_STYLE_NORMAL.
break;
- case ChromeFont::BOLD:
+ case gfx::Font::BOLD:
pango_font_description_set_weight(pfd, PANGO_WEIGHT_BOLD);
break;
- case ChromeFont::ITALIC:
+ case gfx::Font::ITALIC:
pango_font_description_set_style(pfd, PANGO_STYLE_ITALIC);
break;
- case ChromeFont::UNDERLINED:
+ case gfx::Font::UNDERLINED:
// TODO(deanm): How to do underlined? Where do we use it? Probably have
// to paint it ourselves, see pango_font_metrics_get_underline_position.
break;
@@ -246,9 +246,9 @@ AutocompletePopupViewGtk::AutocompletePopupViewGtk(
// We always ellipsize when drawing our text runs.
pango_layout_set_ellipsize(layout_, PANGO_ELLIPSIZE_END);
// TODO(deanm): We might want to eventually follow what Windows does and
- // plumb a ChromeFont through. This is because popup windows have a
+ // plumb a gfx::Font through. This is because popup windows have a
// different font size, although we could just derive that font here.
- PangoFontDescription* pfd = PangoFontFromChromeFont(ChromeFont());
+ PangoFontDescription* pfd = PangoFontFromGfxFont(gfx::Font());
pango_layout_set_font_description(layout_, pfd);
pango_font_description_free(pfd);
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_win.cc b/chrome/browser/autocomplete/autocomplete_popup_view_win.cc
index 98be163..7450655 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_win.cc
@@ -87,10 +87,10 @@ int AutocompletePopupViewWin::MirroringContext::GetLeft(int x1, int x2) const {
const wchar_t AutocompletePopupViewWin::DrawLineInfo::ellipsis_str[] =
L"\x2026";
-AutocompletePopupViewWin::DrawLineInfo::DrawLineInfo(const ChromeFont& font) {
+AutocompletePopupViewWin::DrawLineInfo::DrawLineInfo(const gfx::Font& font) {
// Create regular and bold fonts.
regular_font = font.DeriveFont(-1);
- bold_font = regular_font.DeriveFont(0, ChromeFont::BOLD);
+ bold_font = regular_font.DeriveFont(0, gfx::Font::BOLD);
// The total padding added to each line (bottom padding is what is
// left over after DrawEntry() specifies its top offset).
@@ -186,7 +186,7 @@ COLORREF AutocompletePopupViewWin::DrawLineInfo::AlphaBlend(
}
AutocompletePopupViewWin::AutocompletePopupViewWin(
- const ChromeFont& font,
+ const gfx::Font& font,
AutocompleteEditViewWin* edit_view,
AutocompleteEditModel* edit_model,
Profile* profile)
@@ -680,7 +680,7 @@ void AutocompletePopupViewWin::DrawStar(HDC dc, int x, int y) const {
// static
AutocompletePopupView* AutocompletePopupView::CreatePopupView(
- const ChromeFont& font,
+ const gfx::Font& font,
AutocompleteEditViewWin* edit_view,
AutocompleteEditModel* edit_model,
Profile* profile,
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_win.h b/chrome/browser/autocomplete/autocomplete_popup_view_win.h
index f98346d..bc4e135 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_win.h
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_win.h
@@ -48,7 +48,7 @@ class AutocompletePopupViewWin
MSG_WM_PAINT(OnPaint)
END_MSG_MAP()
- AutocompletePopupViewWin(const ChromeFont& font,
+ AutocompletePopupViewWin(const gfx::Font& font,
AutocompleteEditViewWin* edit_view,
AutocompleteEditModel* edit_model,
Profile* profile);
@@ -82,7 +82,7 @@ class AutocompletePopupViewWin
MAX_STATUS_ENTRIES
};
- explicit DrawLineInfo(const ChromeFont& font);
+ explicit DrawLineInfo(const gfx::Font& font);
~DrawLineInfo();
static COLORREF AlphaBlend(COLORREF foreground,
@@ -91,8 +91,8 @@ class AutocompletePopupViewWin
static const wchar_t ellipsis_str[];
- ChromeFont regular_font; // Fonts used for rendering AutocompleteMatches.
- ChromeFont bold_font;
+ gfx::Font regular_font; // Fonts used for rendering AutocompleteMatches.
+ gfx::Font bold_font;
int font_height; // Height (in pixels) of a line of text w/o
// padding.
int line_height; // Height (in pixels) of a line of text w/padding.