streams_private_api.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (c) 2012 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. #ifndef ELECTRON_SHELL_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_
  5. #define ELECTRON_SHELL_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_
  6. #include <string>
  7. #include "content/public/browser/frame_tree_node_id.h"
  8. #include "third_party/blink/public/mojom/loader/transferrable_url_loader.mojom-forward.h"
  9. class GURL;
  10. namespace extensions {
  11. // TODO(devlin): This is now only used for the MimeTypesHandler API. We should
  12. // rename and move it to make that clear. https://crbug.com/890401.
  13. class StreamsPrivateAPI {
  14. public:
  15. // Send the onExecuteMimeTypeHandler event to |extension_id|. A non-empty
  16. // |stream_id| will be used to identify the created stream during
  17. // MimeHandlerViewGuest creation. |embedded| should be set to whether the
  18. // document is embedded within another document. The |frame_tree_node_id|
  19. // parameter is used for the top level plugins case. (PDF, etc).
  20. static void SendExecuteMimeTypeHandlerEvent(
  21. const std::string& extension_id,
  22. const std::string& stream_id,
  23. bool embedded,
  24. content::FrameTreeNodeId frame_tree_node_id,
  25. blink::mojom::TransferrableURLLoaderPtr transferrable_loader,
  26. const GURL& original_url,
  27. const std::string& internal_id);
  28. };
  29. } // namespace extensions
  30. #endif // ELECTRON_SHELL_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_