Chromium Code Reviews

Unified Diff: content/shell/renderer/test_runner/TestPlugin.cpp

Issue 105633011: BrowserPlugin/WebView - Move plugin lifetime to DOM - The Prequel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove use of npobject. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: content/shell/renderer/test_runner/TestPlugin.cpp
diff --git a/content/shell/renderer/test_runner/TestPlugin.cpp b/content/shell/renderer/test_runner/TestPlugin.cpp
index 421ab780c42adfed4df763de3cdb1c67731686d8..cad1d55e656aeb65711b42399f9d2c603eac70a9 100644
--- a/content/shell/renderer/test_runner/TestPlugin.cpp
+++ b/content/shell/renderer/test_runner/TestPlugin.cpp
@@ -127,7 +127,6 @@ void deferredDelete(void* context)
}
-
TestPlugin::TestPlugin(WebFrame* frame, const WebPluginParams& params, WebTestDelegate* delegate)
: m_frame(frame)
, m_delegate(delegate)
@@ -141,6 +140,8 @@ TestPlugin::TestPlugin(WebFrame* frame, const WebPluginParams& params, WebTestDe
, m_printEventDetails(false)
, m_printUserGestureStatus(false)
, m_canProcessDrag(false)
+ , m_isPersistent(params.mimeType == pluginPersistsMimeType())
+ , m_canCreateWithoutRenderer(params.mimeType == canCreateWithoutRendererMimeType())
{
const CR_DEFINE_STATIC_LOCAL(WebString, kAttributePrimitive, ("primitive"));
const CR_DEFINE_STATIC_LOCAL(WebString, kAttributeBackgroundColor, ("background-color"));
@@ -177,6 +178,8 @@ TestPlugin::TestPlugin(WebFrame* frame, const WebPluginParams& params, WebTestDe
else if (attributeName == kAttributePrintUserGestureStatus)
m_printUserGestureStatus = parseBoolean(attributeValue);
}
+ if (m_canCreateWithoutRenderer)
+ m_delegate->printMessage(std::string("TestPlugin: canCreateWithoutRenderer\n"));
}
TestPlugin::~TestPlugin()
@@ -545,6 +548,8 @@ bool TestPlugin::handleInputEvent(const WebInputEvent& event, WebCursorInfo& inf
printEventDetails(m_delegate, event);
if (m_printUserGestureStatus)
m_delegate->printMessage(std::string("* ") + (WebUserGestureIndicator::isProcessingUserGesture() ? "" : "not ") + "handling user gesture\n");
+ if (m_isPersistent)
+ m_delegate->printMessage(std::string("TestPlugin: isPersistent\n"));
return false;
}
@@ -582,4 +587,23 @@ const WebString& TestPlugin::mimeType()
return kMimeType;
}
+const WebString& TestPlugin::canCreateWithoutRendererMimeType()
+{
+ const CR_DEFINE_STATIC_LOCAL(WebString, kCanCreateWithoutRendererMimeType, ("application/x-webkit-test-webplugin-can-create-without-renderer"));
+ return kCanCreateWithoutRendererMimeType;
+}
+
+const WebString& TestPlugin::pluginPersistsMimeType()
+{
+ const CR_DEFINE_STATIC_LOCAL(WebString, kPluginPersistsMimeType, ("application/x-webkit-test-webplugin-persistent"));
+ return kPluginPersistsMimeType;
+}
+
+bool TestPlugin::isSupportedMimeType(const WebString& mimeType)
+{
+ return mimeType == TestPlugin::mimeType()
+ || mimeType == pluginPersistsMimeType()
+ || mimeType == canCreateWithoutRendererMimeType();
+}
+
}
« no previous file with comments | « content/shell/renderer/test_runner/TestPlugin.h ('k') | content/shell/renderer/test_runner/WebFrameTestProxy.h » ('j') | no next file with comments »

Powered by Google App Engine