diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-13 23:36:00 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-13 23:36:00 +0000 |
commit | 9e823663aa2491262162657c6528123999e0dbb2 (patch) | |
tree | aa8a190b4e960f70b0ec4e9a6741c65a7db36cac /webkit | |
parent | 196e469886b723e8f3531a1fe51204e4dc50dc8b (diff) | |
download | chromium_src-9e823663aa2491262162657c6528123999e0dbb2.zip chromium_src-9e823663aa2491262162657c6528123999e0dbb2.tar.gz chromium_src-9e823663aa2491262162657c6528123999e0dbb2.tar.bz2 |
Use CommandUpdater for disabling commands that were disabled by plugins.
Review URL: http://codereview.chromium.org/3742002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62475 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/pepper_plugin_delegate.h | 4 | ||||
-rw-r--r-- | webkit/glue/plugins/pepper_private.cc | 6 | ||||
-rw-r--r-- | webkit/glue/plugins/ppb_private.h | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/webkit/glue/plugins/pepper_plugin_delegate.h b/webkit/glue/plugins/pepper_plugin_delegate.h index 6173af7..f080f34 100644 --- a/webkit/glue/plugins/pepper_plugin_delegate.h +++ b/webkit/glue/plugins/pepper_plugin_delegate.h @@ -216,8 +216,8 @@ class PluginDelegate { virtual void DidStartLoading() = 0; virtual void DidStopLoading() = 0; - // Disables the given UI command item (i.e. print/copy). - virtual void DisableCommand(int command_id) = 0; + // Sets restrictions on how the content can be used (i.e. no print/copy). + virtual void SetContentRestriction(int restrictions) = 0; }; } // namespace pepper diff --git a/webkit/glue/plugins/pepper_private.cc b/webkit/glue/plugins/pepper_private.cc index de4d180..ae4db34 100644 --- a/webkit/glue/plugins/pepper_private.cc +++ b/webkit/glue/plugins/pepper_private.cc @@ -241,11 +241,11 @@ void DidStopLoading(PP_Instance instance_id) { instance->delegate()->DidStopLoading(); } -void DisableCommand(PP_Instance instance_id, int command_id) { +void SetContentRestriction(PP_Instance instance_id, int restrictions) { PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); if (!instance) return; - instance->delegate()->DisableCommand(command_id); + instance->delegate()->SetContentRestriction(restrictions); } const PPB_Private ppb_private = { @@ -256,7 +256,7 @@ const PPB_Private ppb_private = { &SearchString, &DidStartLoading, &DidStopLoading, - &DisableCommand + &SetContentRestriction }; } // namespace diff --git a/webkit/glue/plugins/ppb_private.h b/webkit/glue/plugins/ppb_private.h index 9f8b93c..a60194c 100644 --- a/webkit/glue/plugins/ppb_private.h +++ b/webkit/glue/plugins/ppb_private.h @@ -118,8 +118,9 @@ struct PPB_Private { void (*DidStartLoading)(PP_Instance instance); void (*DidStopLoading)(PP_Instance instance); - // Disables the given command (i.e. print/copy). - void (*DisableCommand)(PP_Instance instance, int command_id); + // Sets content restriction for a full-page plugin (i.e. can't copy/print). + // The value is a bitfield of ContentRestriction enums. + void (*SetContentRestriction)(PP_Instance instance, int restrictions); }; #endif // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ |