OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 explicit StreamsPrivateAPI(content::BrowserContext* context); | 33 explicit StreamsPrivateAPI(content::BrowserContext* context); |
34 ~StreamsPrivateAPI() override; | 34 ~StreamsPrivateAPI() override; |
35 | 35 |
36 // Send the onExecuteMimeTypeHandler event to |extension_id|. | 36 // Send the onExecuteMimeTypeHandler event to |extension_id|. |
37 // |web_contents| is used to determine the tabId where the document is being | 37 // |web_contents| is used to determine the tabId where the document is being |
38 // opened. The data for the document will be readable from |stream|, and | 38 // opened. The data for the document will be readable from |stream|, and |
39 // should be |expected_content_size| bytes long. If the viewer is being opened | 39 // should be |expected_content_size| bytes long. If the viewer is being opened |
40 // in a BrowserPlugin, specify a non-empty |view_id| of the plugin. |embedded| | 40 // in a BrowserPlugin, specify a non-empty |view_id| of the plugin. |embedded| |
41 // should be set to whether the document is embedded within another document. | 41 // should be set to whether the document is embedded within another document. |
| 42 // The |frame_tree_node_id| parameter is used for PlzNavigate for the top |
| 43 // level plugins case. (PDF, etc). If this parameter has a valid value then |
| 44 // it overrides the |render_process_id| and |render_frame_id| parameters. |
| 45 // The |render_process_id| is the id of the renderer process. |
| 46 // The |render_frame_id| is the routing id of the RenderFrameHost. |
42 void ExecuteMimeTypeHandler(const std::string& extension_id, | 47 void ExecuteMimeTypeHandler(const std::string& extension_id, |
43 content::WebContents* web_contents, | 48 content::WebContents* web_contents, |
44 std::unique_ptr<content::StreamInfo> stream, | 49 std::unique_ptr<content::StreamInfo> stream, |
45 const std::string& view_id, | 50 const std::string& view_id, |
46 int64_t expected_content_size, | 51 int64_t expected_content_size, |
47 bool embedded, | 52 bool embedded, |
| 53 int frame_tree_node_id, |
48 int render_process_id, | 54 int render_process_id, |
49 int render_frame_id); | 55 int render_frame_id); |
50 | 56 |
51 void AbortStream(const std::string& extension_id, | 57 void AbortStream(const std::string& extension_id, |
52 const GURL& stream_url, | 58 const GURL& stream_url, |
53 const base::Closure& callback); | 59 const base::Closure& callback); |
54 | 60 |
55 // BrowserContextKeyedAPI implementation. | 61 // BrowserContextKeyedAPI implementation. |
56 static BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* GetFactoryInstance(); | 62 static BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* GetFactoryInstance(); |
57 | 63 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 103 |
98 private: | 104 private: |
99 void OnClose(); | 105 void OnClose(); |
100 | 106 |
101 std::string stream_url_; | 107 std::string stream_url_; |
102 }; | 108 }; |
103 | 109 |
104 } // namespace extensions | 110 } // namespace extensions |
105 | 111 |
106 #endif // CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ | 112 #endif // CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ |
OLD | NEW |