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

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

Issue 10917225: Browser Plugin: Reload and Stop operations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nit Created 8 years, 3 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 d8c75ad5bece01eaafc258f690db6a230278023b..0479550c5779355c2fabfea2a3b42bcb8fb9cc2c 100644
--- a/content/renderer/browser_plugin/browser_plugin_bindings.cc
+++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc
@@ -39,14 +39,24 @@ namespace content {
namespace {
const char kAddEventListener[] = "addEventListener";
+const char kReloadMethod[] = "reload";
const char kRemoveEventListener[] = "removeEventListener";
const char kSrcAttribute[] = "src";
+const char kStopMethod[] = "stop";
BrowserPluginBindings* GetBindings(NPObject* object) {
return static_cast<BrowserPluginBindings::BrowserPluginNPObject*>(object)->
message_channel;
}
+bool IdentifierIsReload(NPIdentifier identifier) {
+ return WebBindings::getStringIdentifier(kReloadMethod) == identifier;
+}
+
+bool IdentifierIsStop(NPIdentifier identifier) {
+ return WebBindings::getStringIdentifier(kStopMethod) == identifier;
+}
+
bool IdentifierIsAddEventListener(NPIdentifier identifier) {
return WebBindings::getStringIdentifier(kAddEventListener) == identifier;
}
@@ -112,6 +122,12 @@ bool BrowserPluginBindingsHasMethod(NPObject* np_obj, NPIdentifier name) {
if (IdentifierIsRemoveEventListener(name))
return true;
+ if (IdentifierIsStop(name))
+ return true;
+
+ if (IdentifierIsReload(name))
+ return true;
+
return false;
}
@@ -154,6 +170,16 @@ bool BrowserPluginBindingsInvoke(NPObject* np_obj, NPIdentifier name,
return bindings->instance()->RemoveEventListener(event_name, function);
}
+ if (IdentifierIsStop(name) && !arg_count) {
+ bindings->instance()->Stop();
+ return true;
+ }
+
+ if (IdentifierIsReload(name) && !arg_count) {
+ bindings->instance()->Reload();
+ return true;
+ }
+
return false;
}
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | content/renderer/browser_plugin/browser_plugin_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698