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

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

Issue 11554030: <webview>: Add name attribute (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 7 years, 11 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
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 2bf0387fe1f25c8b4d64758759bdc5ca61564800..a6cfb39dc0fb7325f27b37b15b1e98f3e3321554 100644
--- a/content/renderer/browser_plugin/browser_plugin_bindings.cc
+++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc
@@ -54,6 +54,7 @@ const char kAttributeMaxHeight[] = "maxHeight";
const char kAttributeMaxWidth[] = "maxWidth";
const char kAttributeMinHeight[] = "minHeight";
const char kAttributeMinWidth[] = "minWidth";
+const char kAttributeName[] = "name";
const char kAttributePartition[] = "partition";
const char kAttributeSrc[] = "src";
@@ -576,6 +577,33 @@ class BrowserPluginPropertyBindingMinWidth
DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingMinWidth);
};
+class BrowserPluginPropertyBindingName
+ : public BrowserPluginPropertyBinding {
+ public:
+ BrowserPluginPropertyBindingName() :
+ BrowserPluginPropertyBinding(kAttributeName) {
+ }
+ virtual bool GetProperty(BrowserPluginBindings* bindings,
+ NPVariant* result) OVERRIDE {
+ std::string name = bindings->instance()->name_attribute();
+ return StringToNPVariant(name, result);
+ return true;
+ }
+ virtual bool SetProperty(BrowserPluginBindings* bindings,
+ NPObject* np_obj,
+ const NPVariant* variant) OVERRIDE {
+ std::string name = StringFromNPVariant(*variant);
+ bindings->instance()->SetNameAttribute(name);
+ return true;
+ }
+ virtual std::string GetDOMAttributeValue(
+ BrowserPlugin* browser_plugin) OVERRIDE {
+ return browser_plugin->name_attribute();
+ }
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingName);
+};
+
class BrowserPluginPropertyBindingPartition
: public BrowserPluginPropertyBinding {
public:
@@ -672,6 +700,7 @@ BrowserPluginBindings::BrowserPluginBindings(BrowserPlugin* instance)
property_bindings_.push_back(new BrowserPluginPropertyBindingMaxWidth);
property_bindings_.push_back(new BrowserPluginPropertyBindingMinHeight);
property_bindings_.push_back(new BrowserPluginPropertyBindingMinWidth);
+ property_bindings_.push_back(new BrowserPluginPropertyBindingName);
property_bindings_.push_back(new BrowserPluginPropertyBindingPartition);
property_bindings_.push_back(new BrowserPluginPropertyBindingSrc);
}
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | content/renderer/browser_plugin/browser_plugin_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698