diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-26 19:05:28 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-26 19:05:28 +0000 |
commit | 208aad79d76c5c9a5e05322be674b2d81738cb68 (patch) | |
tree | 6286cbea3bd340d8d5f61af9f6ace0b3d15e236c /ppapi/shared_impl | |
parent | b6b19e26bb00c8e8bc4ab91b535520352fb009f9 (diff) | |
download | chromium_src-208aad79d76c5c9a5e05322be674b2d81738cb68.zip chromium_src-208aad79d76c5c9a5e05322be674b2d81738cb68.tar.gz chromium_src-208aad79d76c5c9a5e05322be674b2d81738cb68.tar.bz2 |
Use the WebKit default fonts when specifying generic font families.
This pipes through a new preferences object that the font system can use.
It now picks up these faces as well as the default font size.
Clarify this behavior in the interface.
TEST=manual (font example included).
BUG=none
Review URL: http://codereview.chromium.org/7053022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86870 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/shared_impl')
-rw-r--r-- | ppapi/shared_impl/ppapi_preferences.cc | 28 | ||||
-rw-r--r-- | ppapi/shared_impl/ppapi_preferences.h | 30 | ||||
-rw-r--r-- | ppapi/shared_impl/webkit_forwarding.h | 4 |
3 files changed, 61 insertions, 1 deletions
diff --git a/ppapi/shared_impl/ppapi_preferences.cc b/ppapi/shared_impl/ppapi_preferences.cc new file mode 100644 index 0000000..1448806 --- /dev/null +++ b/ppapi/shared_impl/ppapi_preferences.cc @@ -0,0 +1,28 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ppapi/shared_impl/ppapi_preferences.h" + +#include "webkit/glue/webpreferences.h" + +namespace ppapi { + +Preferences::Preferences() + : default_font_size(0), + default_fixed_font_size(0) { +} + +Preferences::Preferences(const WebPreferences& prefs) + : standard_font_family(prefs.standard_font_family), + fixed_font_family(prefs.fixed_font_family), + serif_font_family(prefs.serif_font_family), + sans_serif_font_family(prefs.sans_serif_font_family), + default_font_size(prefs.default_font_size), + default_fixed_font_size(prefs.default_fixed_font_size) { +} + +Preferences::~Preferences() { +} + +} // namespace ppapi diff --git a/ppapi/shared_impl/ppapi_preferences.h b/ppapi/shared_impl/ppapi_preferences.h new file mode 100644 index 0000000..e026290 --- /dev/null +++ b/ppapi/shared_impl/ppapi_preferences.h @@ -0,0 +1,30 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PPAPI_SHARED_IMPL_PPAPI_PREFERENCES_H_ +#define PPAPI_SHARED_IMPL_PPAPI_PREFERENCES_H_ + +#include "base/string16.h" + +struct WebPreferences; + +namespace ppapi { + +struct Preferences { + public: + Preferences(); + explicit Preferences(const WebPreferences& prefs); + ~Preferences(); + + string16 standard_font_family; + string16 fixed_font_family; + string16 serif_font_family; + string16 sans_serif_font_family; + int default_font_size; + int default_fixed_font_size; +}; + +} // namespace ppapi + +#endif // PPAPI_SHARED_IMPL_PPAPI_PREFERENCES_H_ diff --git a/ppapi/shared_impl/webkit_forwarding.h b/ppapi/shared_impl/webkit_forwarding.h index 4f45344..2094523 100644 --- a/ppapi/shared_impl/webkit_forwarding.h +++ b/ppapi/shared_impl/webkit_forwarding.h @@ -25,6 +25,8 @@ class PlatformCanvas; namespace ppapi { +struct Preferences; + class WebKitForwarding { public: class Font { @@ -93,8 +95,8 @@ class WebKitForwarding { virtual void CreateFontForwarding(base::WaitableEvent* event, const PP_FontDescription_Dev& desc, const std::string& desc_face, + const Preferences& prefs, Font** result) = 0; - }; } // namespace ppapi |