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 // Defines the Chrome Extensions Tab Capture API functions for accessing | 5 // Defines the Chrome Extensions Tab Capture API functions for accessing |
6 // tab media streams. | 6 // tab media streams. |
7 | 7 |
8 #ifndef CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_API_H_ |
9 #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_API_H_ |
10 | 10 |
11 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" | 11 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" |
12 #include "chrome/browser/extensions/chrome_extension_function.h" | 12 #include "chrome/browser/extensions/chrome_extension_function.h" |
13 #include "chrome/common/extensions/api/tab_capture.h" | 13 #include "chrome/common/extensions/api/tab_capture.h" |
| 14 #include "chrome/common/extensions/api/tab_capture_private.h" |
14 | 15 |
15 namespace extensions { | 16 namespace extensions { |
16 | 17 |
17 // Extension ids for the chromecast. | 18 // Extension ids for the chromecast. |
18 extern const char* const kChromecastExtensionIds[6]; | 19 extern const char* const kChromecastExtensionIds[6]; |
19 | 20 |
20 class TabCaptureCaptureFunction : public ChromeSyncExtensionFunction { | 21 class TabCaptureCaptureFunction : public ChromeSyncExtensionFunction { |
21 public: | 22 public: |
22 DECLARE_EXTENSION_FUNCTION("tabCapture.capture", TABCAPTURE_CAPTURE) | 23 DECLARE_EXTENSION_FUNCTION("tabCapture.capture", TABCAPTURE_CAPTURE) |
23 | 24 |
24 protected: | 25 private: |
25 ~TabCaptureCaptureFunction() override {} | 26 ~TabCaptureCaptureFunction() final {} |
26 | 27 |
27 // ExtensionFunction: | 28 // ExtensionFunction: |
28 bool RunSync() override; | 29 bool RunSync() final; |
29 }; | 30 }; |
30 | 31 |
31 class TabCaptureGetCapturedTabsFunction : public ChromeSyncExtensionFunction { | 32 class TabCaptureGetCapturedTabsFunction : public ChromeSyncExtensionFunction { |
32 public: | 33 public: |
33 DECLARE_EXTENSION_FUNCTION("tabCapture.getCapturedTabs", | 34 DECLARE_EXTENSION_FUNCTION("tabCapture.getCapturedTabs", |
34 TABCAPTURE_GETCAPTUREDTABS) | 35 TABCAPTURE_GETCAPTUREDTABS) |
35 | 36 |
36 protected: | 37 private: |
37 ~TabCaptureGetCapturedTabsFunction() override {} | 38 ~TabCaptureGetCapturedTabsFunction() final {} |
38 | 39 |
39 // ExtensionFunction: | 40 // ExtensionFunction: |
40 bool RunSync() override; | 41 bool RunSync() final; |
| 42 }; |
| 43 |
| 44 class TabCaptureCaptureOffscreenTabFunction : public SyncExtensionFunction { |
| 45 public: |
| 46 DECLARE_EXTENSION_FUNCTION("tabCapture.captureOffscreenTab", |
| 47 TABCAPTURE_CAPTUREOFFSCREENTAB) |
| 48 |
| 49 // Examines the min/max width/height constraints in the |options| to determine |
| 50 // a suitable initial off-screen tab size. |
| 51 static gfx::Size DetermineInitialSize( |
| 52 const extensions::api::tab_capture::CaptureOptions& options); |
| 53 |
| 54 private: |
| 55 ~TabCaptureCaptureOffscreenTabFunction() final {} |
| 56 |
| 57 // ExtensionFunction: |
| 58 bool RunSync() final; |
| 59 }; |
| 60 |
| 61 class TabCapturePrivateRegisterOffscreenTabAsPresentationFunction |
| 62 : public SyncExtensionFunction { |
| 63 public: |
| 64 DECLARE_EXTENSION_FUNCTION( |
| 65 "tabCapturePrivate.registerOffscreenTabAsPresentation", |
| 66 TABCAPTUREPRIVATE_REGISTEROFFSCREENTABASPRESENTATION) |
| 67 |
| 68 private: |
| 69 ~TabCapturePrivateRegisterOffscreenTabAsPresentationFunction() final {} |
| 70 |
| 71 // ExtensionFunction: |
| 72 bool RunSync() final; |
41 }; | 73 }; |
42 | 74 |
43 } // namespace extensions | 75 } // namespace extensions |
44 | 76 |
45 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_API_H_ | 77 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_API_H_ |
OLD | NEW |