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

Unified Diff: content/renderer/browser_plugin/browser_plugin_bindings.cc

Issue 95693002: <webview>: Expose transparency API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment Created 7 years 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 | « content/renderer/browser_plugin/browser_plugin.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ffeafcf32e2866c0e4517a7ea90da2166776fa3f..2e0ab773315b8ae7bee16f98483c67d533bdc95d 100644
--- a/content/renderer/browser_plugin/browser_plugin_bindings.cc
+++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc
@@ -312,6 +312,41 @@ class BrowserPluginPropertyBinding {
DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBinding);
};
+class BrowserPluginPropertyBindingAllowTransparency
+ : public BrowserPluginPropertyBinding {
+ public:
+ BrowserPluginPropertyBindingAllowTransparency()
+ : BrowserPluginPropertyBinding(
+ browser_plugin::kAttributeAllowTransparency) {
+ }
+ virtual bool GetProperty(BrowserPluginBindings* bindings,
+ NPVariant* result) OVERRIDE {
+ bool allow_transparency =
+ bindings->instance()->GetAllowTransparencyAttribute();
+ BOOLEAN_TO_NPVARIANT(allow_transparency, *result);
+ return true;
+ }
+ virtual bool SetProperty(BrowserPluginBindings* bindings,
+ NPObject* np_obj,
+ const NPVariant* variant) OVERRIDE {
+ std::string value = StringFromNPVariant(*variant);
+ if (!bindings->instance()->HasDOMAttribute(name())) {
+ UpdateDOMAttribute(bindings, value);
+ bindings->instance()->ParseAllowTransparencyAttribute();
+ } else {
+ UpdateDOMAttribute(bindings, value);
+ }
+ return true;
+ }
+ virtual void RemoveProperty(BrowserPluginBindings* bindings,
+ NPObject* np_obj) OVERRIDE {
+ bindings->instance()->RemoveDOMAttribute(name());
+ bindings->instance()->ParseAllowTransparencyAttribute();
+ }
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingAllowTransparency);
+};
+
class BrowserPluginPropertyBindingAutoSize
: public BrowserPluginPropertyBinding {
public:
@@ -638,6 +673,8 @@ BrowserPluginBindings::BrowserPluginBindings(BrowserPlugin* instance)
method_bindings_.push_back(new BrowserPluginBindingAttach);
method_bindings_.push_back(new BrowserPluginBindingAttachWindowTo);
+ property_bindings_.push_back(
+ new BrowserPluginPropertyBindingAllowTransparency);
property_bindings_.push_back(new BrowserPluginPropertyBindingAutoSize);
property_bindings_.push_back(new BrowserPluginPropertyBindingContentWindow);
property_bindings_.push_back(new BrowserPluginPropertyBindingMaxHeight);
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698