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

Unified Diff: webrtc/modules/desktop_capture/window_capturer_win.cc

Issue 2479553006: Remove GetWindowList / GetScreenList and SelectWindow / SelectScreen from WebRTC (Closed)
Patch Set: Resolve review comments Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/window_capturer_win.cc
diff --git a/webrtc/modules/desktop_capture/window_capturer_win.cc b/webrtc/modules/desktop_capture/window_capturer_win.cc
index 101b17a17a8c5e0f05063551f3bccc4122d135a3..feb25c75d78fed3622a66565f20c52cc657d06b0 100644
--- a/webrtc/modules/desktop_capture/window_capturer_win.cc
+++ b/webrtc/modules/desktop_capture/window_capturer_win.cc
@@ -26,8 +26,8 @@ namespace webrtc {
namespace {
BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) {
- WindowCapturer::WindowList* list =
- reinterpret_cast<WindowCapturer::WindowList*>(param);
+ DesktopCapturer::SourceList* list =
+ reinterpret_cast<DesktopCapturer::SourceList*>(param);
// Skip windows that are invisible, minimized, have no title, or are owned,
// unless they have the app window style set.
@@ -62,7 +62,7 @@ BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) {
return TRUE;
}
- WindowCapturer::Window window;
+ DesktopCapturer::Source window;
window.id = reinterpret_cast<WindowId>(hwnd);
const size_t kTitleLength = 500;
@@ -85,14 +85,12 @@ class WindowCapturerWin : public WindowCapturer {
WindowCapturerWin();
~WindowCapturerWin() override;
- // WindowCapturer interface.
- bool GetWindowList(WindowList* windows) override;
- bool SelectWindow(WindowId id) override;
- bool BringSelectedWindowToFront() override;
-
// DesktopCapturer interface.
void Start(Callback* callback) override;
void CaptureFrame() override;
+ bool GetSourceList(SourceList* sources) override;
+ bool SelectSource(SourceId id) override;
+ bool FocusOnSelectedSource() override;
private:
Callback* callback_ = nullptr;
@@ -115,15 +113,15 @@ class WindowCapturerWin : public WindowCapturer {
WindowCapturerWin::WindowCapturerWin() {}
WindowCapturerWin::~WindowCapturerWin() {}
-bool WindowCapturerWin::GetWindowList(WindowList* windows) {
- WindowList result;
+bool WindowCapturerWin::GetSourceList(SourceList* sources) {
+ SourceList result;
LPARAM param = reinterpret_cast<LPARAM>(&result);
if (!EnumWindows(&WindowsEnumerationHandler, param))
return false;
- windows->swap(result);
+ sources->swap(result);
std::map<HWND, DesktopSize> new_map;
- for (const auto& item : *windows) {
+ for (const auto& item : *sources) {
HWND hwnd = reinterpret_cast<HWND>(item.id);
new_map[hwnd] = window_size_map_[hwnd];
}
@@ -132,7 +130,7 @@ bool WindowCapturerWin::GetWindowList(WindowList* windows) {
return true;
}
-bool WindowCapturerWin::SelectWindow(WindowId id) {
+bool WindowCapturerWin::SelectSource(SourceId id) {
HWND window = reinterpret_cast<HWND>(id);
if (!IsWindow(window) || !IsWindowVisible(window) || IsIconic(window))
return false;
@@ -143,7 +141,7 @@ bool WindowCapturerWin::SelectWindow(WindowId id) {
return true;
}
-bool WindowCapturerWin::BringSelectedWindowToFront() {
+bool WindowCapturerWin::FocusOnSelectedSource() {
if (!window_)
return false;
« no previous file with comments | « webrtc/modules/desktop_capture/window_capturer_unittest.cc ('k') | webrtc/modules/desktop_capture/window_capturer_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698