Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: chrome/browser/extensions/api/tab_capture/tab_capture_api.h

Issue 1221483002: New tabCapture.captureOffscreenTab API, initially for Presentation API 1UA mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mostly revert to Patch Set 6, plus minor tweaks. [and REBASE] Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 14
15 namespace extensions { 15 namespace extensions {
16 16
17 // Extension ids for the chromecast. 17 // Extension ids for the chromecast.
18 extern const char* const kChromecastExtensionIds[6]; 18 extern const char* const kChromecastExtensionIds[6];
19 19
20 class TabCaptureCaptureFunction : public ChromeSyncExtensionFunction { 20 class TabCaptureCaptureFunction : public ChromeSyncExtensionFunction {
21 public: 21 public:
22 DECLARE_EXTENSION_FUNCTION("tabCapture.capture", TABCAPTURE_CAPTURE) 22 DECLARE_EXTENSION_FUNCTION("tabCapture.capture", TABCAPTURE_CAPTURE)
23 23
24 protected: 24 private:
25 ~TabCaptureCaptureFunction() override {} 25 ~TabCaptureCaptureFunction() final {}
26 26
27 // ExtensionFunction: 27 // ExtensionFunction:
28 bool RunSync() override; 28 bool RunSync() final;
29 }; 29 };
30 30
31 class TabCaptureGetCapturedTabsFunction : public ChromeSyncExtensionFunction { 31 class TabCaptureGetCapturedTabsFunction : public ChromeSyncExtensionFunction {
32 public: 32 public:
33 DECLARE_EXTENSION_FUNCTION("tabCapture.getCapturedTabs", 33 DECLARE_EXTENSION_FUNCTION("tabCapture.getCapturedTabs",
34 TABCAPTURE_GETCAPTUREDTABS) 34 TABCAPTURE_GETCAPTUREDTABS)
35 35
36 protected: 36 private:
37 ~TabCaptureGetCapturedTabsFunction() override {} 37 ~TabCaptureGetCapturedTabsFunction() final {}
38 38
39 // ExtensionFunction: 39 // ExtensionFunction:
40 bool RunSync() override; 40 bool RunSync() final;
41 };
42
43 class TabCaptureCaptureOffscreenTabFunction : public SyncExtensionFunction {
44 public:
45 DECLARE_EXTENSION_FUNCTION("tabCapture.captureOffscreenTab",
46 TABCAPTURE_CAPTUREOFFSCREENTAB)
47
48 // Examines the min/max width/height constraints in the |options| to determine
49 // a suitable initial off-screen tab size.
50 static gfx::Size DetermineInitialSize(
51 const extensions::api::tab_capture::CaptureOptions& options);
52
53 private:
54 ~TabCaptureCaptureOffscreenTabFunction() final {}
55
56 // ExtensionFunction:
57 bool RunSync() final;
41 }; 58 };
42 59
43 } // namespace extensions 60 } // namespace extensions
44 61
45 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_API_H_ 62 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698