diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 02:16:10 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 02:16:10 +0000 |
commit | 7322c44018c4e7b8bd58c67f52986660fb365d76 (patch) | |
tree | 4bb67ec23689e83682a5aa228e3b8c402880baa8 /views/widget | |
parent | 0c875075a6c45e9979b8345e5f5f9d4b747e05c3 (diff) | |
download | chromium_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 'views/widget')
-rw-r--r-- | views/widget/tooltip_manager.cc | 16 | ||||
-rw-r--r-- | views/widget/tooltip_manager.h | 6 |
2 files changed, 12 insertions, 10 deletions
diff --git a/views/widget/tooltip_manager.cc b/views/widget/tooltip_manager.cc index c082040..9ef9ff9 100644 --- a/views/widget/tooltip_manager.cc +++ b/views/widget/tooltip_manager.cc @@ -52,21 +52,21 @@ int TooltipManager::GetTooltipHeight() { return tooltip_height_; } -static ChromeFont DetermineDefaultFont() { +static gfx::Font DetermineDefaultFont() { HWND window = CreateWindowEx( WS_EX_TRANSPARENT | l10n_util::GetExtendedTooltipStyles(), TOOLTIPS_CLASS, NULL, 0 , 0, 0, 0, 0, NULL, NULL, NULL, NULL); HFONT hfont = reinterpret_cast<HFONT>(SendMessage(window, WM_GETFONT, 0, 0)); - ChromeFont font = hfont ? ChromeFont::CreateFont(hfont) : ChromeFont(); + gfx::Font font = hfont ? gfx::Font::CreateFont(hfont) : gfx::Font(); DestroyWindow(window); return font; } // static -ChromeFont TooltipManager::GetDefaultFont() { - static ChromeFont* font = NULL; +gfx::Font TooltipManager::GetDefaultFont() { + static gfx::Font* font = NULL; if (!font) - font = new ChromeFont(DetermineDefaultFont()); + font = new gfx::Font(DetermineDefaultFont()); return *font; } @@ -264,9 +264,9 @@ int TooltipManager::CalcTooltipHeight() { SetMapMode(dc, last_map_mode); ReleaseDC(NULL, dc); } else { - // Tooltip is using the system font. Use ChromeFont, which should pick + // Tooltip is using the system font. Use gfx::Font, which should pick // up the system font. - height = ChromeFont().height(); + height = gfx::Font().height(); } // Get the margins from the tooltip RECT tooltip_margin; @@ -309,7 +309,7 @@ void TooltipManager::TrimTooltipToFit(std::wstring* text, *line_count = static_cast<int>(lines.size()); // Format each line to fit. - ChromeFont font = GetDefaultFont(); + gfx::Font font = GetDefaultFont(); std::wstring result; for (std::vector<std::wstring>::iterator i = lines.begin(); i != lines.end(); ++i) { diff --git a/views/widget/tooltip_manager.h b/views/widget/tooltip_manager.h index 3d5620d..5cfe2bf 100644 --- a/views/widget/tooltip_manager.h +++ b/views/widget/tooltip_manager.h @@ -12,7 +12,9 @@ #include "base/basictypes.h" #include "base/task.h" -class ChromeFont; +namespace gfx { +class Font; +} namespace views { @@ -55,7 +57,7 @@ class TooltipManager { static int GetTooltipHeight(); // Returns the default font used by tooltips. - static ChromeFont GetDefaultFont(); + static gfx::Font GetDefaultFont(); // Returns the separator for lines of text in a tooltip. static const std::wstring& GetLineSeparator(); |