| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // Convenience method to get the StreamsPrivateAPI for a BrowserContext. | 28 // Convenience method to get the StreamsPrivateAPI for a BrowserContext. |
| 29 static StreamsPrivateAPI* Get(content::BrowserContext* context); | 29 static StreamsPrivateAPI* Get(content::BrowserContext* context); |
| 30 | 30 |
| 31 explicit StreamsPrivateAPI(content::BrowserContext* context); | 31 explicit StreamsPrivateAPI(content::BrowserContext* context); |
| 32 ~StreamsPrivateAPI() override; | 32 ~StreamsPrivateAPI() override; |
| 33 | 33 |
| 34 // Send the onExecuteMimeTypeHandler event to |extension_id|. | 34 // Send the onExecuteMimeTypeHandler event to |extension_id|. |
| 35 // |web_contents| is used to determine the tabId where the document is being | 35 // |web_contents| is used to determine the tabId where the document is being |
| 36 // opened. The data for the document will be readable from |stream|, and | 36 // opened. The data for the document will be readable from |stream|, and |
| 37 // should be |expected_content_size| bytes long. If the viewer is being opened | 37 // should be |expected_content_size| bytes long. If the viewer is being opened |
| 38 // in a BrowserPlugin, specify a non-empty |view_id| of the plugin. | 38 // in a BrowserPlugin, specify a non-empty |view_id| of the plugin. |embedded| |
| 39 // should be set to whether the document is embedded within another document. |
| 39 void ExecuteMimeTypeHandler(const std::string& extension_id, | 40 void ExecuteMimeTypeHandler(const std::string& extension_id, |
| 40 content::WebContents* web_contents, | 41 content::WebContents* web_contents, |
| 41 scoped_ptr<content::StreamInfo> stream, | 42 scoped_ptr<content::StreamInfo> stream, |
| 42 const std::string& view_id, | 43 const std::string& view_id, |
| 43 int64 expected_content_size); | 44 int64 expected_content_size, |
| 45 bool embedded); |
| 44 | 46 |
| 45 void AbortStream(const std::string& extension_id, | 47 void AbortStream(const std::string& extension_id, |
| 46 const GURL& stream_url, | 48 const GURL& stream_url, |
| 47 const base::Closure& callback); | 49 const base::Closure& callback); |
| 48 | 50 |
| 49 // BrowserContextKeyedAPI implementation. | 51 // BrowserContextKeyedAPI implementation. |
| 50 static BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* GetFactoryInstance(); | 52 static BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* GetFactoryInstance(); |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 friend class BrowserContextKeyedAPIFactory<StreamsPrivateAPI>; | 55 friend class BrowserContextKeyedAPIFactory<StreamsPrivateAPI>; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 93 |
| 92 private: | 94 private: |
| 93 void OnClose(); | 95 void OnClose(); |
| 94 | 96 |
| 95 std::string stream_url_; | 97 std::string stream_url_; |
| 96 }; | 98 }; |
| 97 | 99 |
| 98 } // namespace extensions | 100 } // namespace extensions |
| 99 | 101 |
| 100 #endif // CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ | 102 #endif // CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ |
| OLD | NEW |