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

Unified Diff: ppapi/proxy/plugin_dispatcher.cc

Issue 7053022: Use the WebKit default fonts when specifying generic font families. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_dispatcher.cc
===================================================================
--- ppapi/proxy/plugin_dispatcher.cc (revision 86722)
+++ ppapi/proxy/plugin_dispatcher.cc (working copy)
@@ -40,7 +40,8 @@
PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle,
GetInterfaceFunc get_interface)
: Dispatcher(remote_process_handle, get_interface),
- plugin_delegate_(NULL) {
+ plugin_delegate_(NULL),
+ received_preferences_(false) {
SetSerializationRules(new PluginVarSerializationRules);
// As a plugin, we always support the PPP_Class interface. There's no
@@ -122,6 +123,7 @@
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PluginDispatcher, msg)
IPC_MESSAGE_HANDLER(PpapiMsg_SupportsInterface, OnMsgSupportsInterface)
+ IPC_MESSAGE_HANDLER(PpapiMsg_SetPreferences, OnMsgSetPreferences)
IPC_END_MESSAGE_MAP()
return handled;
}
@@ -274,6 +276,20 @@
*result = true;
}
+void PluginDispatcher::OnMsgSetPreferences(const ::ppapi::Preferences& prefs) {
+ // The renderer may send us preferences more than once (currently this
+ // happens every time a new plugin instance is created). Since we don't have
+ // a way to signal to the plugin that the preferences have changed, changing
+ // the default fonts and such in the middle of a running plugin could be
+ // confusing to it. As a result, we never allow the preferences to be changed
+ // once they're set. The user will have to restart to get new font prefs
+ // propogated to plugins.
+ if (!received_preferences_) {
+ received_preferences_ = true;
+ preferences_ = prefs;
+ }
+}
+
} // namespace proxy
} // namespace pp
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698