| 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_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 return "TabCaptureRegistry"; | 75 return "TabCaptureRegistry"; |
| 76 } | 76 } |
| 77 | 77 |
| 78 static const bool kServiceIsCreatedWithBrowserContext = false; | 78 static const bool kServiceIsCreatedWithBrowserContext = false; |
| 79 static const bool kServiceRedirectedInIncognito = true; | 79 static const bool kServiceRedirectedInIncognito = true; |
| 80 | 80 |
| 81 // ExtensionRegistryObserver implementation. | 81 // ExtensionRegistryObserver implementation. |
| 82 virtual void OnExtensionUnloaded( | 82 virtual void OnExtensionUnloaded( |
| 83 content::BrowserContext* browser_context, | 83 content::BrowserContext* browser_context, |
| 84 const Extension* extension, | 84 const Extension* extension, |
| 85 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 85 UnloadedExtensionInfo::Reason reason) override; |
| 86 | 86 |
| 87 // MediaCaptureDevicesDispatcher::Observer implementation. | 87 // MediaCaptureDevicesDispatcher::Observer implementation. |
| 88 virtual void OnRequestUpdate( | 88 virtual void OnRequestUpdate( |
| 89 int original_target_render_process_id, | 89 int original_target_render_process_id, |
| 90 int original_target_render_frame_id, | 90 int original_target_render_frame_id, |
| 91 content::MediaStreamType stream_type, | 91 content::MediaStreamType stream_type, |
| 92 const content::MediaRequestState state) OVERRIDE; | 92 const content::MediaRequestState state) override; |
| 93 | 93 |
| 94 // Send a StatusChanged event containing the current state of |request|. | 94 // Send a StatusChanged event containing the current state of |request|. |
| 95 void DispatchStatusChangeEvent(const LiveRequest* request) const; | 95 void DispatchStatusChangeEvent(const LiveRequest* request) const; |
| 96 | 96 |
| 97 // Look-up a LiveRequest associated with the given |target_contents| (or | 97 // Look-up a LiveRequest associated with the given |target_contents| (or |
| 98 // the originally targetted RenderFrameHost), if any. | 98 // the originally targetted RenderFrameHost), if any. |
| 99 LiveRequest* FindRequest(const content::WebContents* target_contents) const; | 99 LiveRequest* FindRequest(const content::WebContents* target_contents) const; |
| 100 LiveRequest* FindRequest(int original_target_render_process_id, | 100 LiveRequest* FindRequest(int original_target_render_process_id, |
| 101 int original_target_render_frame_id) const; | 101 int original_target_render_frame_id) const; |
| 102 | 102 |
| 103 // Removes the |request| from |requests_|, thus causing its destruction. | 103 // Removes the |request| from |requests_|, thus causing its destruction. |
| 104 void KillRequest(LiveRequest* request); | 104 void KillRequest(LiveRequest* request); |
| 105 | 105 |
| 106 content::BrowserContext* const browser_context_; | 106 content::BrowserContext* const browser_context_; |
| 107 ScopedVector<LiveRequest> requests_; | 107 ScopedVector<LiveRequest> requests_; |
| 108 | 108 |
| 109 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 109 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 110 extension_registry_observer_; | 110 extension_registry_observer_; |
| 111 | 111 |
| 112 DISALLOW_COPY_AND_ASSIGN(TabCaptureRegistry); | 112 DISALLOW_COPY_AND_ASSIGN(TabCaptureRegistry); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 } // namespace extensions | 115 } // namespace extensions |
| 116 | 116 |
| 117 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ | 117 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ |
| OLD | NEW |