| 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 <map> | 7 #include <map> |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 return a.dpi().x() < b.dpi().x(); | 28 return a.dpi().x() < b.dpi().x(); |
| 29 return a.dpi().y() < b.dpi().y(); | 29 return a.dpi().y() < b.dpi().y(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 class DesktopResizerWin : public DesktopResizer { | 32 class DesktopResizerWin : public DesktopResizer { |
| 33 public: | 33 public: |
| 34 DesktopResizerWin(); | 34 DesktopResizerWin(); |
| 35 virtual ~DesktopResizerWin(); | 35 virtual ~DesktopResizerWin(); |
| 36 | 36 |
| 37 // DesktopResizer interface. | 37 // DesktopResizer interface. |
| 38 virtual ScreenResolution GetCurrentResolution() OVERRIDE; | 38 virtual ScreenResolution GetCurrentResolution() override; |
| 39 virtual std::list<ScreenResolution> GetSupportedResolutions( | 39 virtual std::list<ScreenResolution> GetSupportedResolutions( |
| 40 const ScreenResolution& preferred) OVERRIDE; | 40 const ScreenResolution& preferred) override; |
| 41 virtual void SetResolution(const ScreenResolution& resolution) OVERRIDE; | 41 virtual void SetResolution(const ScreenResolution& resolution) override; |
| 42 virtual void RestoreResolution(const ScreenResolution& original) OVERRIDE; | 42 virtual void RestoreResolution(const ScreenResolution& original) override; |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 static bool IsResizeSupported(); | 45 static bool IsResizeSupported(); |
| 46 | 46 |
| 47 // Calls EnumDisplaySettingsEx() for the primary monitor. | 47 // Calls EnumDisplaySettingsEx() for the primary monitor. |
| 48 // Returns false if |mode_number| does not exist. | 48 // Returns false if |mode_number| does not exist. |
| 49 static bool GetPrimaryDisplayMode( | 49 static bool GetPrimaryDisplayMode( |
| 50 DWORD mode_number, DWORD flags, DEVMODE* mode); | 50 DWORD mode_number, DWORD flags, DEVMODE* mode); |
| 51 | 51 |
| 52 // Returns true if the mode has width, height, bits-per-pixel, frequency | 52 // Returns true if the mode has width, height, bits-per-pixel, frequency |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 return ScreenResolution( | 182 return ScreenResolution( |
| 183 webrtc::DesktopSize(mode.dmPelsWidth, mode.dmPelsHeight), | 183 webrtc::DesktopSize(mode.dmPelsWidth, mode.dmPelsHeight), |
| 184 webrtc::DesktopVector(kDefaultDPI, kDefaultDPI)); | 184 webrtc::DesktopVector(kDefaultDPI, kDefaultDPI)); |
| 185 } | 185 } |
| 186 | 186 |
| 187 scoped_ptr<DesktopResizer> DesktopResizer::Create() { | 187 scoped_ptr<DesktopResizer> DesktopResizer::Create() { |
| 188 return make_scoped_ptr(new DesktopResizerWin); | 188 return make_scoped_ptr(new DesktopResizerWin); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace remoting | 191 } // namespace remoting |
| OLD | NEW |