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

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

Issue 1199073002: Enable cropping window capturing for Win7 when Aero is disabled. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 5 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 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 c7e1fd879c8e46967e4cb63155888afba68b5abc..885e8f4aa9291788b0a87e8bf30a03cd12f80afd 100644
--- a/webrtc/modules/desktop_capture/window_capturer_win.cc
+++ b/webrtc/modules/desktop_capture/window_capturer_win.cc
@@ -22,8 +22,6 @@ namespace webrtc {
namespace {
-typedef HRESULT (WINAPI *DwmIsCompositionEnabledFunc)(BOOL* enabled);
-
BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) {
WindowCapturer::WindowList* list =
reinterpret_cast<WindowCapturer::WindowList*>(param);
@@ -81,18 +79,12 @@ class WindowCapturerWin : public WindowCapturer {
void Capture(const DesktopRegion& region) override;
private:
- bool IsAeroEnabled();
-
Callback* callback_;
// HWND and HDC for the currently selected window or NULL if window is not
// selected.
HWND window_;
- // dwmapi.dll is used to determine if desktop compositing is enabled.
- HMODULE dwmapi_library_;
- DwmIsCompositionEnabledFunc is_composition_enabled_func_;
-
DesktopSize previous_size_;
DISALLOW_COPY_AND_ASSIGN(WindowCapturerWin);
@@ -101,28 +93,9 @@ class WindowCapturerWin : public WindowCapturer {
WindowCapturerWin::WindowCapturerWin()
: callback_(NULL),
window_(NULL) {
- // Try to load dwmapi.dll dynamically since it is not available on XP.
- dwmapi_library_ = LoadLibrary(L"dwmapi.dll");
- if (dwmapi_library_) {
- is_composition_enabled_func_ =
- reinterpret_cast<DwmIsCompositionEnabledFunc>(
- GetProcAddress(dwmapi_library_, "DwmIsCompositionEnabled"));
- assert(is_composition_enabled_func_);
- } else {
- is_composition_enabled_func_ = NULL;
- }
}
WindowCapturerWin::~WindowCapturerWin() {
- if (dwmapi_library_)
- FreeLibrary(dwmapi_library_);
-}
-
-bool WindowCapturerWin::IsAeroEnabled() {
- BOOL result = FALSE;
- if (is_composition_enabled_func_)
- is_composition_enabled_func_(&result);
- return result != FALSE;
}
bool WindowCapturerWin::GetWindowList(WindowList* windows) {

Powered by Google App Engine
This is Rietveld 408576698