Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / streams_private / streams_private_api.h
index 0ac149f..daa81c4 100644 (file)
@@ -30,11 +30,21 @@ class StreamsPrivateAPI : public BrowserContextKeyedAPI,
   explicit StreamsPrivateAPI(content::BrowserContext* context);
   virtual ~StreamsPrivateAPI();
 
+  // Send the onExecuteMimeTypeHandler event to |extension_id|.
+  // |web_contents| is used to determine the tabId where the document is being
+  // opened. The data for the document will be readable from |stream|, and
+  // should be |expected_content_size| bytes long. If the viewer is being opened
+  // in a BrowserPlugin, specify a non-empty |view_id| of the plugin.
   void ExecuteMimeTypeHandler(const std::string& extension_id,
                               content::WebContents* web_contents,
                               scoped_ptr<content::StreamHandle> stream,
+                              const std::string& view_id,
                               int64 expected_content_size);
 
+  void AbortStream(const std::string& extension_id,
+                   const GURL& stream_url,
+                   const base::Closure& callback);
+
   // BrowserContextKeyedAPI implementation.
   static BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* GetFactoryInstance();
 
@@ -66,6 +76,23 @@ class StreamsPrivateAPI : public BrowserContextKeyedAPI,
       extension_registry_observer_;
 };
 
+class StreamsPrivateAbortFunction : public UIThreadExtensionFunction {
+ public:
+  StreamsPrivateAbortFunction();
+  DECLARE_EXTENSION_FUNCTION("streamsPrivate.abort", STREAMSPRIVATE_ABORT)
+
+ protected:
+  virtual ~StreamsPrivateAbortFunction() {}
+
+  // ExtensionFunction:
+  virtual ExtensionFunction::ResponseAction Run() OVERRIDE;
+
+ private:
+  void OnClose();
+
+  std::string stream_url_;
+};
+
 }  // namespace extensions
 
 #endif  // CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_