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 12 matching lines...) Expand all Loading... | |
23 | 23 |
24 class StreamsPrivateAPI : public BrowserContextKeyedAPI, | 24 class StreamsPrivateAPI : public BrowserContextKeyedAPI, |
25 public ExtensionRegistryObserver { | 25 public ExtensionRegistryObserver { |
26 public: | 26 public: |
27 // Convenience method to get the StreamsPrivateAPI for a BrowserContext. | 27 // Convenience method to get the StreamsPrivateAPI for a BrowserContext. |
28 static StreamsPrivateAPI* Get(content::BrowserContext* context); | 28 static StreamsPrivateAPI* Get(content::BrowserContext* context); |
29 | 29 |
30 explicit StreamsPrivateAPI(content::BrowserContext* context); | 30 explicit StreamsPrivateAPI(content::BrowserContext* context); |
31 virtual ~StreamsPrivateAPI(); | 31 virtual ~StreamsPrivateAPI(); |
32 | 32 |
33 // Send the onExecuteMimeTypeHandler event to |extension_id|. | |
34 // |web_contents| is used to determine the tabId where the document is being | |
35 // opened. The data for the document will be readable from |stream|, and | |
36 // should be |expected_content_size| bytes long. If the viewer is already | |
37 // being opened in a BrowserPlugin, |view_id| will be the ID sent to the | |
38 // viewer. | |
not at google - send to devlin
2014/04/30 15:42:43
the implementation implies that |web_contents| is
Zachary Kuznia
2014/05/01 00:38:22
Updated the language for view_id.
| |
33 void ExecuteMimeTypeHandler(const std::string& extension_id, | 39 void ExecuteMimeTypeHandler(const std::string& extension_id, |
34 const content::WebContents* web_contents, | 40 const content::WebContents* web_contents, |
35 scoped_ptr<content::StreamHandle> stream, | 41 scoped_ptr<content::StreamHandle> stream, |
42 const std::string& view_id, | |
36 int64 expected_content_size); | 43 int64 expected_content_size); |
37 | 44 |
38 // BrowserContextKeyedAPI implementation. | 45 // BrowserContextKeyedAPI implementation. |
39 static BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* GetFactoryInstance(); | 46 static BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* GetFactoryInstance(); |
40 | 47 |
41 private: | 48 private: |
42 friend class BrowserContextKeyedAPIFactory<StreamsPrivateAPI>; | 49 friend class BrowserContextKeyedAPIFactory<StreamsPrivateAPI>; |
43 typedef std::map<std::string, | 50 typedef std::map<std::string, |
44 std::map<GURL, | 51 std::map<GURL, |
45 linked_ptr<content::StreamHandle> > > StreamMap; | 52 linked_ptr<content::StreamHandle> > > StreamMap; |
(...skipping 16 matching lines...) Expand all Loading... | |
62 base::WeakPtrFactory<StreamsPrivateAPI> weak_ptr_factory_; | 69 base::WeakPtrFactory<StreamsPrivateAPI> weak_ptr_factory_; |
63 | 70 |
64 // Listen to extension unloaded notifications. | 71 // Listen to extension unloaded notifications. |
65 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 72 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
66 extension_registry_observer_; | 73 extension_registry_observer_; |
67 }; | 74 }; |
68 | 75 |
69 } // namespace extensions | 76 } // namespace extensions |
70 | 77 |
71 #endif // CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ | 78 #endif // CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_PRIVATE_API_H_ |
OLD | NEW |