OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 rect.left + border.width(), | 36 rect.left + border.width(), |
37 rect.top, | 37 rect.top, |
38 rect.right - border.width(), | 38 rect.right - border.width(), |
39 rect.bottom - border.height()); | 39 rect.bottom - border.height()); |
40 } else { | 40 } else { |
41 *cropped_rect = *original_rect; | 41 *cropped_rect = *original_rect; |
42 } | 42 } |
43 return true; | 43 return true; |
44 } | 44 } |
45 | 45 |
| 46 AeroChecker::AeroChecker() : dwmapi_library_(nullptr), func_(nullptr) { |
| 47 // Try to load dwmapi.dll dynamically since it is not available on XP. |
| 48 dwmapi_library_ = LoadLibrary(L"dwmapi.dll"); |
| 49 if (dwmapi_library_) { |
| 50 func_ = reinterpret_cast<DwmIsCompositionEnabledFunc>( |
| 51 GetProcAddress(dwmapi_library_, "DwmIsCompositionEnabled")); |
| 52 } |
| 53 } |
| 54 |
| 55 AeroChecker::~AeroChecker() { |
| 56 if (dwmapi_library_) { |
| 57 FreeLibrary(dwmapi_library_); |
| 58 } |
| 59 } |
| 60 |
| 61 bool AeroChecker::IsAeroEnabled() { |
| 62 BOOL result = FALSE; |
| 63 if (func_) { |
| 64 func_(&result); |
| 65 } |
| 66 return result != FALSE; |
| 67 } |
| 68 |
46 } // namespace webrtc | 69 } // namespace webrtc |
OLD | NEW |