diff options
author | lazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-23 23:32:52 +0000 |
---|---|---|
committer | lazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-23 23:32:52 +0000 |
commit | 048b61c2df38c332a0d5773ac31d57a06b24d2c2 (patch) | |
tree | 98fe7ef4ff2609492838524b5a253a36e3eafcca | |
parent | ddd43d0c35f187dde8db0ad70acef2847c1ac423 (diff) | |
download | chromium_src-048b61c2df38c332a0d5773ac31d57a06b24d2c2.zip chromium_src-048b61c2df38c332a0d5773ac31d57a06b24d2c2.tar.gz chromium_src-048b61c2df38c332a0d5773ac31d57a06b24d2c2.tar.bz2 |
Fix some webview plugin attach-ment code.
We would show error message on attach failure now, we used to always return true from attachWindowAndSetUpEvents().
attachWindowAndSetUpEvents() now return the value of -internal-attach call. -internal-attach did not used to return value, now it returns the status of the attachment call from BrowserPluginBindings.
Removed 3 unused variables referring to browserPluginNode.
BUG=None
Review URL: https://codereview.chromium.org/284183013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272634 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/resources/extensions/web_view.js | 9 | ||||
-rw-r--r-- | content/renderer/browser_plugin/browser_plugin_bindings.cc | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/chrome/renderer/resources/extensions/web_view.js b/chrome/renderer/resources/extensions/web_view.js index f00fb9b..77bc1a4 100644 --- a/chrome/renderer/resources/extensions/web_view.js +++ b/chrome/renderer/resources/extensions/web_view.js @@ -706,9 +706,7 @@ WebViewInternal.prototype.handleDialogEvent = }; var self = this; - var browserPluginNode = this.browserPluginNode; var webviewNode = this.webviewNode; - var requestId = event.requestId; var actionTaken = false; @@ -823,7 +821,6 @@ WebViewInternal.prototype.handleNewWindowEvent = }; var self = this; - var browserPluginNode = this.browserPluginNode; var webviewNode = this.webviewNode; var requestId = event.requestId; @@ -929,9 +926,7 @@ WebViewInternal.prototype.handlePermissionEvent = return; } - var browserPluginNode = this.browserPluginNode; var webviewNode = this.webviewNode; - var decisionMade = false; var validateCall = function() { @@ -1078,9 +1073,7 @@ WebViewInternal.prototype.attachWindowAndSetUpEvents = function(instanceId) { this.setupEvent(eventName, events[eventName]); } - this.browserPluginNode['-internal-attach'](this.instanceId, params); - - return true; + return this.browserPluginNode['-internal-attach'](this.instanceId, params); }; // Registers browser plugin <object> custom element. diff --git a/content/renderer/browser_plugin/browser_plugin_bindings.cc b/content/renderer/browser_plugin/browser_plugin_bindings.cc index e78248f..624e19f 100644 --- a/content/renderer/browser_plugin/browser_plugin_bindings.cc +++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc @@ -236,6 +236,13 @@ class BrowserPluginBindingAttach: public BrowserPluginMethodBinding { virtual bool Invoke(BrowserPluginBindings* bindings, const NPVariant* args, NPVariant* result) OVERRIDE { + bool attached = InvokeHelper(bindings, args); + BOOLEAN_TO_NPVARIANT(attached, *result); + return true; + } + + private: + bool InvokeHelper(BrowserPluginBindings* bindings, const NPVariant* args) { if (!bindings->instance()->render_view()) return false; @@ -259,8 +266,6 @@ class BrowserPluginBindingAttach: public BrowserPluginMethodBinding { bindings->instance()->Attach(instance_id, extra_params.Pass()); return true; } - - private: DISALLOW_COPY_AND_ASSIGN(BrowserPluginBindingAttach); }; |