plugin.mojom 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. module chrome.mojom;
  5. import "content/public/common/webplugininfo.mojom";
  6. import "mojo/public/mojom/base/file_path.mojom";
  7. import "mojo/public/mojom/base/string16.mojom";
  8. import "url/mojom/origin.mojom";
  9. import "url/mojom/url.mojom";
  10. // Plugin messages sent from renderer to the host.
  11. interface PluginHost {
  12. [EnableIf=enable_plugins]
  13. // Tells the browser that there was an error loading a plugin.
  14. CouldNotLoadPlugin(mojo_base.mojom.FilePath file_path);
  15. [EnableIf=enable_plugins]
  16. // Notifies when a plugin couldn't be loaded because it's outdated.
  17. BlockedOutdatedPlugin(pending_remote<PluginRenderer> plugin_renderer,
  18. string group_id);
  19. // Tells the browser to open a PDF file. Used when no PDF Viewer is
  20. // available, and the user clicks to view a PDF from the placeholder UI.
  21. OpenPDF(url.mojom.Url url);
  22. };
  23. // Plugin messages sent from renderer to the host requiring user auth actions.
  24. interface PluginAuthHost {
  25. // Notifies when a plugin couldn't be loaded because it requires
  26. // user authorization.
  27. BlockedUnauthorizedPlugin(mojo_base.mojom.String16 name, string group_id);
  28. };
  29. // These are only used internally, so the order does not matter.
  30. enum PluginStatus {
  31. kAllowed,
  32. // Plugin is blocked, but still can be manually loaded via context menu.
  33. kBlocked,
  34. // Plugin is blocked by policy, so it cannot be manually loaded.
  35. kBlockedByPolicy,
  36. // Plugin is blocked, and cannot be manually loaded via context menu.
  37. kBlockedNoLoading,
  38. kDisabled,
  39. kNotFound,
  40. kOutdatedBlocked,
  41. kOutdatedDisallowed,
  42. // Similar to kOutdatedBlocked or kOutdatedDisallowed, but with no hope of
  43. // updating and running. This is distinct to allow for separate UI treatment.
  44. kDeprecated,
  45. kPlayImportantContent,
  46. kUnauthorized,
  47. };
  48. struct PluginInfo {
  49. PluginStatus status;
  50. content.mojom.WebPluginInfo plugin;
  51. string actual_mime_type;
  52. string group_identifier;
  53. mojo_base.mojom.String16 group_name;
  54. };
  55. struct PluginParam {
  56. mojo_base.mojom.String16 name;
  57. mojo_base.mojom.String16 value;
  58. };
  59. interface PluginInfoHost {
  60. // Return information about a plugin for the given URL and MIME type.
  61. // Includes specific reasons why a plugin can't be used, for example because
  62. // it's disabled.
  63. [Sync]
  64. GetPluginInfo(url.mojom.Url url,
  65. url.mojom.Origin origin,
  66. string mime_type) => (PluginInfo plugin_info);
  67. };
  68. // Plugin messages sent from a host to the renderer.
  69. interface PluginRenderer {
  70. // Notifies a missing plugin placeholder that we have finished downloading
  71. // the plugin.
  72. FinishedDownloading();
  73. // Notifies a missing plugin placeholder that we have finished component-
  74. // updating the plug-in.
  75. UpdateSuccess();
  76. // Notifies a missing plugin placeholder that we have failed to
  77. // component-update the plug-in.
  78. UpdateFailure();
  79. // Notifies a missing plugin placeholder that we have started the component
  80. // download.
  81. UpdateDownloading();
  82. };