Chromium Code Reviews| Index: content/renderer/browser_plugin/browser_plugin_bindings.cc |
| diff --git a/content/renderer/browser_plugin/browser_plugin_bindings.cc b/content/renderer/browser_plugin/browser_plugin_bindings.cc |
| index 142adc96e2f5e5b69a36b0df0c01fcb7295cd43b..5add62f664cf565f9bcec440ca2bcb4966ce7c36 100644 |
| --- a/content/renderer/browser_plugin/browser_plugin_bindings.cc |
| +++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc |
| @@ -338,6 +338,28 @@ class BrowserPluginBindingGo : public BrowserPluginMethodBinding { |
| DISALLOW_COPY_AND_ASSIGN(BrowserPluginBindingGo); |
| }; |
| +// Note: This is a method that is used internally by the <webview> shim only. |
| +// This should not be exposed to developers. |
| +class BrowserPluginBindingPersistRequestObject |
|
Fady Samuel
2013/02/07 15:40:34
Get rid of "request" to allow this to be used by w
lazyboy
2013/02/07 21:24:41
See my comments in .cc file.
|
| + : public BrowserPluginMethodBinding { |
| + public: |
| + BrowserPluginBindingPersistRequestObject() |
| + : BrowserPluginMethodBinding(browser_plugin::kMethodInternalPersistObject, |
| + 2) { |
| + } |
| + |
| + virtual bool Invoke(BrowserPluginBindings* bindings, |
| + const NPVariant* args, |
| + NPVariant* result) OVERRIDE { |
| + bindings->instance()->PersistRequestObject( |
| + &args[0], Int32FromNPVariant(args[1])); |
| + return true; |
| + } |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(BrowserPluginBindingPersistRequestObject); |
| +}; |
| + |
| class BrowserPluginBindingReload : public BrowserPluginMethodBinding { |
| public: |
| BrowserPluginBindingReload() |
| @@ -372,6 +394,29 @@ class BrowserPluginBindingStop : public BrowserPluginMethodBinding { |
| DISALLOW_COPY_AND_ASSIGN(BrowserPluginBindingStop); |
| }; |
| +// Note: This is a method that is used internally by the <webview> shim only. |
| +// This should not be exposed to developers. |
| +class BrowserPluginBindingSetMediaPermission |
| + : public BrowserPluginMethodBinding { |
| + public: |
| + BrowserPluginBindingSetMediaPermission() |
|
Fady Samuel
2013/02/07 15:40:34
To reduce the number of new methods we introduce,
lazyboy
2013/02/07 21:24:41
Done.
|
| + : BrowserPluginMethodBinding( |
| + browser_plugin::kMethodInternalSetMediaPermission, 2) { |
| + } |
| + |
| + virtual bool Invoke(BrowserPluginBindings* bindings, |
| + const NPVariant* args, |
| + NPVariant* result) OVERRIDE { |
| + int request_id = Int32FromNPVariant(args[0]); |
| + bool allow = NPVARIANT_TO_BOOLEAN(args[1]); |
| + bindings->instance()->OnListenerCallMediaAccess(request_id, allow); |
| + return true; |
| + } |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(BrowserPluginBindingSetMediaPermission); |
| +}; |
| + |
| class BrowserPluginBindingTerminate : public BrowserPluginMethodBinding { |
| public: |
| BrowserPluginBindingTerminate() |
| @@ -755,7 +800,9 @@ BrowserPluginBindings::BrowserPluginBindings(BrowserPlugin* instance) |
| method_bindings_.push_back(new BrowserPluginBindingGetProcessID); |
| method_bindings_.push_back(new BrowserPluginBindingGetRouteID); |
| method_bindings_.push_back(new BrowserPluginBindingGo); |
| + method_bindings_.push_back(new BrowserPluginBindingPersistRequestObject); |
| method_bindings_.push_back(new BrowserPluginBindingReload); |
| + method_bindings_.push_back(new BrowserPluginBindingSetMediaPermission); |
| method_bindings_.push_back(new BrowserPluginBindingStop); |
| method_bindings_.push_back(new BrowserPluginBindingTerminate); |