CefWebPluginInfoVisitor.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. namespace Xilium.CefGlue
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Diagnostics;
  6. using System.Runtime.InteropServices;
  7. using Xilium.CefGlue.Interop;
  8. /// <summary>
  9. /// Interface to implement for visiting web plugin information. The methods of
  10. /// this class will be called on the browser process UI thread.
  11. /// </summary>
  12. public abstract unsafe partial class CefWebPluginInfoVisitor
  13. {
  14. private int visit(cef_web_plugin_info_visitor_t* self, cef_web_plugin_info_t* info, int count, int total)
  15. {
  16. CheckSelf(self);
  17. var m_info = CefWebPluginInfo.FromNative(info); // TODO dispose?
  18. var result = Visit(m_info, count, total);
  19. return result ? 1 : 0;
  20. }
  21. /// <summary>
  22. /// Method that will be called once for each plugin. |count| is the 0-based
  23. /// index for the current plugin. |total| is the total number of plugins.
  24. /// Return false to stop visiting plugins. This method may never be called if
  25. /// no plugins are found.
  26. /// </summary>
  27. protected abstract bool Visit(CefWebPluginInfo info, int count, int total);
  28. }
  29. }