bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& event) { if (m_isWindowed || !m_impl) return false; if ((event.type() == WebEvent::MouseDown || event.type() == WebEvent::MouseUp) && event.button() == WebMouseEvent::RightButton && quirks().contains(PluginQuirks::IgnoreRightClickInWindowlessMode)) return false; return m_impl->handleMouseEvent(event); }
const char* NetscapePlugin::userAgent() { #if PLUGIN_ARCHITECTURE(WIN) static const char* MozillaUserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0"; if (quirks().contains(PluginQuirks::WantsMozillaUserAgent)) return MozillaUserAgent; #endif if (m_userAgent.isNull()) { String userAgent = controller()->userAgent(); ASSERT(!userAgent.isNull()); #if PLUGIN_ARCHITECTURE(MAC) if (quirks().contains(PluginQuirks::AppendVersion3UserAgent)) userAgent.append(" Version/3.2.1"); #endif m_userAgent = userAgent.utf8(); } return m_userAgent.data(); }
const char* NetscapePlugin::userAgent() { if (m_userAgent.isNull()) { String userAgent = controller()->userAgent(); ASSERT(!userAgent.isNull()); #if PLUGIN_ARCHITECTURE(MAC) if (quirks().contains(PluginQuirks::AppendVersion3UserAgent)) userAgent.append(" Version/3.2.1"); #endif m_userAgent = userAgent.utf8(); } return m_userAgent.data(); }
bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& event) { if (m_isWindowed) return false; if ((event.type() == WebEvent::MouseDown || event.type() == WebEvent::MouseUp) && event.button() == WebMouseEvent::RightButton && quirks().contains(PluginQuirks::IgnoreRightClickInWindowlessMode)) return false; XEvent xEvent; initializeXEvent(xEvent); switch (event.type()) { case WebEvent::MouseDown: case WebEvent::MouseUp: setXButtonEventFields(xEvent, event, convertToRootView(IntPoint())); break; case WebEvent::MouseMove: setXMotionEventFields(xEvent, event, convertToRootView(IntPoint())); break; case WebEvent::NoType: case WebEvent::Wheel: case WebEvent::KeyDown: case WebEvent::KeyUp: case WebEvent::RawKeyDown: case WebEvent::Char: #if ENABLE(GESTURE_EVENTS) case WebEvent::GestureScrollBegin: case WebEvent::GestureScrollEnd: #endif #if ENABLE(TOUCH_EVENTS) case WebEvent::TouchStart: case WebEvent::TouchMove: case WebEvent::TouchEnd: case WebEvent::TouchCancel: #endif return false; } return !NPP_HandleEvent(&xEvent); }
int PluginPackage::compare(const PluginPackage& compareTo) const { // Sort plug-ins that allow multiple instances first. bool AallowsMultipleInstances = !quirks().contains(PluginQuirkDontAllowMultipleInstances); bool BallowsMultipleInstances = !compareTo.quirks().contains(PluginQuirkDontAllowMultipleInstances); if (AallowsMultipleInstances != BallowsMultipleInstances) return AallowsMultipleInstances ? -1 : 1; // Sort plug-ins in a preferred path first. bool AisInPreferredDirectory = PluginDatabase::isPreferredPluginDirectory(parentDirectory()); bool BisInPreferredDirectory = PluginDatabase::isPreferredPluginDirectory(compareTo.parentDirectory()); if (AisInPreferredDirectory != BisInPreferredDirectory) return AisInPreferredDirectory ? -1 : 1; int diff = strcmp(name().utf8().data(), compareTo.name().utf8().data()); if (diff) return diff; if (diff = compareFileVersion(compareTo.version())) return diff; return strcmp(parentDirectory().utf8().data(), compareTo.parentDirectory().utf8().data()); }