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

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

Issue 2272563011: [Extensions] Convert some SyncExtensionFunctions (Closed)
Patch Set: fix Created 4 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/tab_capture/tab_capture_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 stable / beta cast extensions. Included in 17 // Extension ids for stable / beta cast extensions. Included in
18 // |kChromecastExtensionIds|. 18 // |kChromecastExtensionIds|.
19 extern const char* const kBetaChromecastExtensionId; 19 extern const char* const kBetaChromecastExtensionId;
20 extern const char* const kStableChromecastExtensionId; 20 extern const char* const kStableChromecastExtensionId;
21 21
22 // Extension ids for the chromecast. 22 // Extension ids for the chromecast.
23 extern const char* const kChromecastExtensionIds[6]; 23 extern const char* const kChromecastExtensionIds[6];
24 24
25 class TabCaptureCaptureFunction : public ChromeSyncExtensionFunction { 25 class TabCaptureCaptureFunction : public ChromeSyncExtensionFunction {
lazyboy 2016/08/26 18:05:14 This and GetCapturedTabsFunction still left out? I
Devlin 2016/08/26 18:23:35 Only addressing SyncExtensionFunction right now; w
lazyboy 2016/08/26 19:52:40 My bad, I was looking at the second line of CL des
26 public: 26 public:
27 DECLARE_EXTENSION_FUNCTION("tabCapture.capture", TABCAPTURE_CAPTURE) 27 DECLARE_EXTENSION_FUNCTION("tabCapture.capture", TABCAPTURE_CAPTURE)
28 28
29 private: 29 private:
30 ~TabCaptureCaptureFunction() final {} 30 ~TabCaptureCaptureFunction() final {}
31 31
32 // ExtensionFunction: 32 // ExtensionFunction:
33 bool RunSync() final; 33 bool RunSync() final;
34 }; 34 };
35 35
36 class TabCaptureGetCapturedTabsFunction : public ChromeSyncExtensionFunction { 36 class TabCaptureGetCapturedTabsFunction : public ChromeSyncExtensionFunction {
37 public: 37 public:
38 DECLARE_EXTENSION_FUNCTION("tabCapture.getCapturedTabs", 38 DECLARE_EXTENSION_FUNCTION("tabCapture.getCapturedTabs",
39 TABCAPTURE_GETCAPTUREDTABS) 39 TABCAPTURE_GETCAPTUREDTABS)
40 40
41 private: 41 private:
42 ~TabCaptureGetCapturedTabsFunction() final {} 42 ~TabCaptureGetCapturedTabsFunction() final {}
43 43
44 // ExtensionFunction: 44 // ExtensionFunction:
45 bool RunSync() final; 45 bool RunSync() final;
46 }; 46 };
47 47
48 class TabCaptureCaptureOffscreenTabFunction : public SyncExtensionFunction { 48 class TabCaptureCaptureOffscreenTabFunction : public UIThreadExtensionFunction {
49 public: 49 public:
50 DECLARE_EXTENSION_FUNCTION("tabCapture.captureOffscreenTab", 50 DECLARE_EXTENSION_FUNCTION("tabCapture.captureOffscreenTab",
51 TABCAPTURE_CAPTUREOFFSCREENTAB) 51 TABCAPTURE_CAPTUREOFFSCREENTAB)
52 52
53 // Examines the min/max width/height constraints in the |options| to determine 53 // Examines the min/max width/height constraints in the |options| to determine
54 // a suitable initial off-screen tab size. 54 // a suitable initial off-screen tab size.
55 static gfx::Size DetermineInitialSize( 55 static gfx::Size DetermineInitialSize(
56 const extensions::api::tab_capture::CaptureOptions& options); 56 const extensions::api::tab_capture::CaptureOptions& options);
57 57
58 private: 58 private:
59 ~TabCaptureCaptureOffscreenTabFunction() final {} 59 ~TabCaptureCaptureOffscreenTabFunction() final {}
60 60
61 // ExtensionFunction: 61 // ExtensionFunction:
62 bool RunSync() final; 62 ResponseAction Run() final;
63 }; 63 };
64 64
65 } // namespace extensions 65 } // namespace extensions
66 66
67 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_API_H_ 67 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/tab_capture/tab_capture_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698