| Index: content/renderer/browser_plugin/browser_plugin_bindings.cc
|
| ===================================================================
|
| --- content/renderer/browser_plugin/browser_plugin_bindings.cc (revision 170866)
|
| +++ content/renderer/browser_plugin/browser_plugin_bindings.cc (working copy)
|
| @@ -10,7 +10,6 @@
|
| #include "base/bind.h"
|
| #include "base/message_loop.h"
|
| #include "base/string16.h"
|
| -#include "base/string_number_conversions.h"
|
| #include "base/string_split.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "content/renderer/browser_plugin/browser_plugin.h"
|
| @@ -393,7 +392,6 @@
|
| explicit BrowserPluginPropertyBinding(const char name[]) : name_(name) {
|
| }
|
| virtual ~BrowserPluginPropertyBinding() {}
|
| - const std::string& name() const { return name_; }
|
| bool MatchesName(NPIdentifier name) const {
|
| return WebBindings::getStringIdentifier(name_.c_str()) == name;
|
| }
|
| @@ -402,12 +400,6 @@
|
| virtual bool SetProperty(BrowserPluginBindings* bindings,
|
| NPObject* np_obj,
|
| const NPVariant* variant) = 0;
|
| - virtual std::string GetDOMAttributeValue(BrowserPlugin* browser_plugin) = 0;
|
| - // Updates the DOM Attribute value with the current property value.
|
| - void UpdateDOMAttribute(BrowserPluginBindings* bindings) {
|
| - bindings->instance()->UpdateDOMAttribute(name(),
|
| - GetDOMAttributeValue(bindings->instance()));
|
| - }
|
| private:
|
| std::string name_;
|
|
|
| @@ -422,21 +414,17 @@
|
| }
|
| virtual bool GetProperty(BrowserPluginBindings* bindings,
|
| NPVariant* result) OVERRIDE {
|
| - bool auto_size = bindings->instance()->auto_size_attribute();
|
| - BOOLEAN_TO_NPVARIANT(auto_size, *result);
|
| + bool autosize = bindings->instance()->auto_size_attribute();
|
| + BOOLEAN_TO_NPVARIANT(autosize, *result);
|
| return true;
|
| }
|
| virtual bool SetProperty(BrowserPluginBindings* bindings,
|
| NPObject* np_obj,
|
| const NPVariant* variant) OVERRIDE {
|
| - bool auto_size = NPVARIANT_TO_BOOLEAN(*variant);
|
| - bindings->instance()->SetAutoSizeAttribute(auto_size);
|
| + bool autosize = NPVARIANT_TO_BOOLEAN(*variant);
|
| + bindings->instance()->SetAutoSizeAttribute(autosize);
|
| return true;
|
| }
|
| - virtual std::string GetDOMAttributeValue(
|
| - BrowserPlugin* browser_plugin) OVERRIDE {
|
| - return browser_plugin->auto_size_attribute() ? "true" : "false";
|
| - }
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingAutoSize);
|
| };
|
| @@ -461,9 +449,6 @@
|
| const NPVariant* variant) OVERRIDE {
|
| return false;
|
| }
|
| - virtual std::string GetDOMAttributeValue(BrowserPlugin* browser_plugin) {
|
| - return std::string();
|
| - }
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingContentWindow);
|
| };
|
| @@ -487,10 +472,6 @@
|
| bindings->instance()->SetMaxHeightAttribute(max_height);
|
| return true;
|
| }
|
| - virtual std::string GetDOMAttributeValue(
|
| - BrowserPlugin* browser_plugin) OVERRIDE {
|
| - return base::IntToString(browser_plugin->max_height_attribute());
|
| - }
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingMaxHeight);
|
| };
|
| @@ -514,10 +495,6 @@
|
| bindings->instance()->SetMaxWidthAttribute(max_width);
|
| return true;
|
| }
|
| - virtual std::string GetDOMAttributeValue(
|
| - BrowserPlugin* browser_plugin) OVERRIDE {
|
| - return base::IntToString(browser_plugin->max_width_attribute());
|
| - }
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingMaxWidth);
|
| };
|
| @@ -541,10 +518,6 @@
|
| bindings->instance()->SetMinHeightAttribute(min_height);
|
| return true;
|
| }
|
| - virtual std::string GetDOMAttributeValue(
|
| - BrowserPlugin* browser_plugin) OVERRIDE {
|
| - return base::IntToString(browser_plugin->min_height_attribute());
|
| - }
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingMinHeight);
|
| };
|
| @@ -568,10 +541,6 @@
|
| bindings->instance()->SetMinWidthAttribute(min_width);
|
| return true;
|
| }
|
| - virtual std::string GetDOMAttributeValue(
|
| - BrowserPlugin* browser_plugin) OVERRIDE {
|
| - return base::IntToString(browser_plugin->min_width_attribute());
|
| - }
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingMinWidth);
|
| };
|
| @@ -600,10 +569,6 @@
|
| }
|
| return true;
|
| }
|
| - virtual std::string GetDOMAttributeValue(
|
| - BrowserPlugin* browser_plugin) OVERRIDE {
|
| - return browser_plugin->GetPartitionAttribute();
|
| - }
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingPartition);
|
| };
|
| @@ -630,10 +595,6 @@
|
| }
|
| return true;
|
| }
|
| - virtual std::string GetDOMAttributeValue(
|
| - BrowserPlugin* browser_plugin) OVERRIDE {
|
| - return browser_plugin->src_attribute();
|
| - }
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(BrowserPluginPropertyBindingSrc);
|
| };
|
| @@ -719,13 +680,8 @@
|
| for (PropertyBindingList::iterator iter = property_bindings_.begin();
|
| iter != property_bindings_.end();
|
| ++iter) {
|
| - if ((*iter)->MatchesName(name)) {
|
| - if ((*iter)->SetProperty(this, np_obj, variant)) {
|
| - (*iter)->UpdateDOMAttribute(this);
|
| - return true;
|
| - }
|
| - break;
|
| - }
|
| + if ((*iter)->MatchesName(name))
|
| + return (*iter)->SetProperty(this, np_obj, variant);
|
| }
|
| return false;
|
| }
|
|
|