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

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: Addressed comments + merged with ToT/latest patch 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..5ce81580996a1244f25072f492963425b9e39fd3 100644
--- a/content/renderer/browser_plugin/browser_plugin_bindings.cc
+++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc
@@ -40,6 +40,8 @@ namespace {
const char kAddEventListener[] = "addEventListener";
const char kRemoveEventListener[] = "removeEventListener";
+const char kReloadMethod[] = "reload";
+const char kStopMethod[] = "stop";
const char kSrcAttribute[] = "src";
BrowserPluginBindings* GetBindings(NPObject* object) {
@@ -47,6 +49,14 @@ BrowserPluginBindings* GetBindings(NPObject* 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,15 @@ 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();
lazyboy 2012/09/19 15:06:06 return true; here too?
Fady Samuel 2012/09/19 15:50:56 Done.
+ }
+
return false;
}

Powered by Google App Engine
This is Rietveld 408576698