summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-26 19:05:28 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-26 19:05:28 +0000
commit208aad79d76c5c9a5e05322be674b2d81738cb68 (patch)
tree6286cbea3bd340d8d5f61af9f6ace0b3d15e236c /content
parentb6b19e26bb00c8e8bc4ab91b535520352fb009f9 (diff)
downloadchromium_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 'content')
-rw-r--r--content/ppapi_plugin/ppapi_thread.h15
-rw-r--r--content/renderer/pepper_plugin_delegate_impl.cc16
-rw-r--r--content/renderer/pepper_plugin_delegate_impl.h1
3 files changed, 22 insertions, 10 deletions
diff --git a/content/ppapi_plugin/ppapi_thread.h b/content/ppapi_plugin/ppapi_thread.h
index a9d0b7c..3d20387 100644
--- a/content/ppapi_plugin/ppapi_thread.h
+++ b/content/ppapi_plugin/ppapi_thread.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/process.h"
#include "base/scoped_native_library.h"
@@ -31,16 +32,16 @@ class PpapiThread : public ChildThread,
private:
// ChildThread overrides.
- virtual bool OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
// Dispatcher::Delegate implementation.
- virtual base::MessageLoopProxy* GetIPCMessageLoop();
- virtual base::WaitableEvent* GetShutdownEvent();
- virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet();
- virtual ppapi::WebKitForwarding* GetWebKitForwarding();
+ virtual base::MessageLoopProxy* GetIPCMessageLoop() OVERRIDE;
+ virtual base::WaitableEvent* GetShutdownEvent() OVERRIDE;
+ virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet() OVERRIDE;
+ virtual ppapi::WebKitForwarding* GetWebKitForwarding() OVERRIDE;
virtual void PostToWebKitThread(const tracked_objects::Location& from_here,
- const base::Closure& task);
- virtual bool SendToBrowser(IPC::Message* msg);
+ const base::Closure& task) OVERRIDE;
+ virtual bool SendToBrowser(IPC::Message* msg) OVERRIDE;
// Message handlers.
void OnMsgLoadPlugin(const FilePath& path);
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index 856beee..74f091c 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -45,6 +45,7 @@
#include "ppapi/c/private/ppb_flash_net_connector.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/ppapi_preferences.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserCompletion.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
@@ -328,7 +329,8 @@ class DispatcherWrapper
DispatcherWrapper() {}
virtual ~DispatcherWrapper() {}
- bool Init(base::ProcessHandle plugin_process_handle,
+ bool Init(RenderView* render_view,
+ base::ProcessHandle plugin_process_handle,
const IPC::ChannelHandle& channel_handle,
PP_Module pp_module,
pp::proxy::Dispatcher::GetInterfaceFunc local_get_interface);
@@ -351,6 +353,7 @@ class DispatcherWrapper
} // namespace
bool DispatcherWrapper::Init(
+ RenderView* render_view,
base::ProcessHandle plugin_process_handle,
const IPC::ChannelHandle& channel_handle,
PP_Module pp_module,
@@ -358,8 +361,10 @@ bool DispatcherWrapper::Init(
dispatcher_.reset(new pp::proxy::HostDispatcher(
plugin_process_handle, pp_module, local_get_interface));
- if (!dispatcher_->InitHostWithChannel(PepperPluginRegistry::GetInstance(),
- channel_handle, true)) {
+ if (!dispatcher_->InitHostWithChannel(
+ PepperPluginRegistry::GetInstance(),
+ channel_handle, true,
+ ppapi::Preferences(render_view->webkit_preferences()))) {
dispatcher_.reset();
return false;
}
@@ -608,6 +613,7 @@ PepperPluginDelegateImpl::CreatePepperPlugin(
PepperPluginRegistry::GetInstance()->AddLiveModule(path, module);
scoped_ptr<DispatcherWrapper> dispatcher(new DispatcherWrapper);
if (!dispatcher->Init(
+ render_view_,
plugin_process_handle, channel_handle,
module->pp_module(),
webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc()))
@@ -1313,3 +1319,7 @@ base::SharedMemory* PepperPluginDelegateImpl::CreateAnonymousSharedMemory(
}
return new base::SharedMemory(handle, false);
}
+
+ppapi::Preferences PepperPluginDelegateImpl::GetPreferences() {
+ return ppapi::Preferences(render_view_->webkit_preferences());
+}
diff --git a/content/renderer/pepper_plugin_delegate_impl.h b/content/renderer/pepper_plugin_delegate_impl.h
index bab21c4..f75121d 100644
--- a/content/renderer/pepper_plugin_delegate_impl.h
+++ b/content/renderer/pepper_plugin_delegate_impl.h
@@ -273,6 +273,7 @@ class PepperPluginDelegateImpl
virtual double GetLocalTimeZoneOffset(base::Time t);
virtual std::string GetFlashCommandLineArgs();
virtual base::SharedMemory* CreateAnonymousSharedMemory(uint32_t size);
+ virtual ::ppapi::Preferences GetPreferences();
private:
// Asynchronously attempts to create a PPAPI broker for the given plugin.