| OLD | NEW |
| 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 #include "remoting/host/desktop_resizer.h" | 5 #include "remoting/host/desktop_resizer.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 |
| 8 #include <map> | 9 #include <map> |
| 9 | 10 |
| 10 #include "base/logging.h" | 11 #include "base/logging.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ptr_util.h" |
| 12 | 14 |
| 13 namespace { | 15 namespace { |
| 14 // TODO(jamiewalch): Use the correct DPI for the mode: http://crbug.com/172405. | 16 // TODO(jamiewalch): Use the correct DPI for the mode: http://crbug.com/172405. |
| 15 const int kDefaultDPI = 96; | 17 const int kDefaultDPI = 96; |
| 16 } // namespace | 18 } // namespace |
| 17 | 19 |
| 18 namespace remoting { | 20 namespace remoting { |
| 19 | 21 |
| 20 // Provide comparison operation for ScreenResolution so we can use it in | 22 // Provide comparison operation for ScreenResolution so we can use it in |
| 21 // std::map. | 23 // std::map. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } | 180 } |
| 179 | 181 |
| 180 // static | 182 // static |
| 181 ScreenResolution DesktopResizerWin::GetModeResolution(const DEVMODE& mode) { | 183 ScreenResolution DesktopResizerWin::GetModeResolution(const DEVMODE& mode) { |
| 182 DCHECK(IsModeValid(mode)); | 184 DCHECK(IsModeValid(mode)); |
| 183 return ScreenResolution( | 185 return ScreenResolution( |
| 184 webrtc::DesktopSize(mode.dmPelsWidth, mode.dmPelsHeight), | 186 webrtc::DesktopSize(mode.dmPelsWidth, mode.dmPelsHeight), |
| 185 webrtc::DesktopVector(kDefaultDPI, kDefaultDPI)); | 187 webrtc::DesktopVector(kDefaultDPI, kDefaultDPI)); |
| 186 } | 188 } |
| 187 | 189 |
| 188 scoped_ptr<DesktopResizer> DesktopResizer::Create() { | 190 std::unique_ptr<DesktopResizer> DesktopResizer::Create() { |
| 189 return make_scoped_ptr(new DesktopResizerWin); | 191 return base::WrapUnique(new DesktopResizerWin); |
| 190 } | 192 } |
| 191 | 193 |
| 192 } // namespace remoting | 194 } // namespace remoting |
| OLD | NEW |