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

Unified Diff: ui/base/resource/resource_bundle.h

Issue 19666006: Supports FontList in Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removes ResourceBundle::Delegate::GetFontList. Created 7 years, 5 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: ui/base/resource/resource_bundle.h
diff --git a/ui/base/resource/resource_bundle.h b/ui/base/resource/resource_bundle.h
index d44c7db69fa9110d0c35b7b7b470efe446d541a6..f9a34df3f1be4584ed11c820dc94e69152d219d2 100644
--- a/ui/base/resource/resource_bundle.h
+++ b/ui/base/resource/resource_bundle.h
@@ -20,7 +20,7 @@
#include "base/strings/string_piece.h"
#include "ui/base/layout.h"
#include "ui/base/ui_export.h"
-#include "ui/gfx/font.h"
+#include "ui/gfx/font_list.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/native_widget_types.h"
@@ -107,8 +107,7 @@ class UI_EXPORT ResourceBundle {
// false to attempt retrieval of the default string.
virtual bool GetLocalizedString(int message_id, string16* value) = 0;
- // Return a font resource or NULL to attempt retrieval of the default
- // resource.
+ // Returns a font or NULL to attempt retrieval of the default resource.
virtual scoped_ptr<gfx::Font> GetFont(FontStyle style) = 0;
protected:
@@ -233,6 +232,9 @@ class UI_EXPORT ResourceBundle {
// string if the message_id is not found.
string16 GetLocalizedString(int message_id);
+ // Returns the font list for the specified style.
+ const gfx::FontList& GetFontList(FontStyle style);
+
// Returns the font for the specified style.
const gfx::Font& GetFont(FontStyle style);
@@ -301,9 +303,14 @@ class UI_EXPORT ResourceBundle {
// comments for ReloadLocaleResources().
void UnloadLocaleResources();
- // Initialize all the gfx::Font members if they haven't yet been initialized.
+ // Initializes all the gfx::FontList members if they haven't yet been
+ // initialized.
void LoadFontsIfNecessary();
+ // Returns a FontList or NULL by calling Delegate::GetFont and converting
+ // scoped_ptr<gfx::Font> to scoped_ptr<gfx::FontList>.
+ scoped_ptr<gfx::FontList> GetFontListFromDelegate(FontStyle style);
+
// Fills the |bitmap| given the data file to look in and the |resource_id|.
// Returns false if the resource does not exist.
//
@@ -370,16 +377,17 @@ class UI_EXPORT ResourceBundle {
gfx::Image empty_image_;
- // The various fonts used. Cached to avoid repeated GDI creation/destruction.
- scoped_ptr<gfx::Font> base_font_;
- scoped_ptr<gfx::Font> bold_font_;
- scoped_ptr<gfx::Font> small_font_;
- scoped_ptr<gfx::Font> small_bold_font_;
- scoped_ptr<gfx::Font> medium_font_;
- scoped_ptr<gfx::Font> medium_bold_font_;
- scoped_ptr<gfx::Font> large_font_;
- scoped_ptr<gfx::Font> large_bold_font_;
- scoped_ptr<gfx::Font> web_font_;
+ // The various font lists used. Cached to avoid repeated GDI
+ // creation/destruction.
+ scoped_ptr<gfx::FontList> base_font_list_;
+ scoped_ptr<gfx::FontList> bold_font_list_;
+ scoped_ptr<gfx::FontList> small_font_list_;
+ scoped_ptr<gfx::FontList> small_bold_font_list_;
+ scoped_ptr<gfx::FontList> medium_font_list_;
+ scoped_ptr<gfx::FontList> medium_bold_font_list_;
+ scoped_ptr<gfx::FontList> large_font_list_;
+ scoped_ptr<gfx::FontList> large_bold_font_list_;
+ scoped_ptr<gfx::FontList> web_font_list_;
base::FilePath overridden_pak_path_;

Powered by Google App Engine
This is Rietveld 408576698