pdf.mojom 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 pdf.mojom;
  5. import "services/network/public/mojom/referrer_policy.mojom";
  6. import "ui/gfx/geometry/mojom/geometry.mojom";
  7. import "url/mojom/url.mojom";
  8. interface PdfListener {
  9. // Sets the current caret position.
  10. SetCaretPosition(gfx.mojom.PointF position);
  11. // Move the end of the range selection to |extent|.
  12. MoveRangeSelectionExtent(gfx.mojom.PointF extent);
  13. // Sets the selection to be between |base| and |extent|. The |extent| will
  14. // be moved if the selection is modified.
  15. SetSelectionBounds(gfx.mojom.PointF base, gfx.mojom.PointF extent);
  16. };
  17. // Browser-side interface shared by PDF plugins and PDF renderers.
  18. interface PdfService {
  19. SetListener(pending_remote<PdfListener> client);
  20. // Updates the content restrictions, i.e. to disable print/copy.
  21. UpdateContentRestrictions(int32 restrictions);
  22. // The currently displayed PDF has an unsupported feature.
  23. HasUnsupportedFeature();
  24. // Brings up SaveAs... dialog to save specified URL.
  25. SaveUrlAs(url.mojom.Url url, network.mojom.ReferrerPolicy policy);
  26. // Notifies the embedder of the top-left and bottom-right coordinates of the
  27. // current selection.
  28. SelectionChanged(gfx.mojom.PointF left, int32 left_height,
  29. gfx.mojom.PointF right, int32 right_height);
  30. // Notifies the embedder know the plugin can handle save commands internally.
  31. SetPluginCanSave(bool can_save);
  32. };