Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef REMOTING_HOST_DESKTOP_RESIZER_H_ | |
| 6 #define REMOTING_HOST_DESKTOP_RESIZER_H_ | |
| 7 | |
| 8 #include <list> | |
| 9 | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "third_party/skia/include/core/SkRect.h" | |
| 12 | |
| 13 namespace remoting { | |
| 14 | |
| 15 class DesktopResizer { | |
| 16 public: | |
| 17 virtual ~DesktopResizer() {} | |
| 18 | |
| 19 // Create a platform-specific DesktopResizer instance. | |
| 20 static scoped_ptr<DesktopResizer> Create(); | |
| 21 | |
| 22 // Return the current size of the desktop, or 0x0 if resize is not supported. | |
|
Wez
2012/09/25 20:48:29
nit: Is the implementation _required_ to return 0x
Jamie
2012/09/25 23:20:20
It doesn't actually matter. If it returns non-zero
| |
| 23 virtual SkISize GetCurrentSize() = 0; | |
| 24 | |
| 25 // Get the list of supported sizes, which should ideally include |preferred|. | |
| 26 // Implementations will generally do one of the following: | |
| 27 // 1. Return the list of sizes supported by the underlying video driver, | |
| 28 // regardless of |preferred|. | |
| 29 // 2. Return a list containing just |preferred|, perhaps after imposing | |
| 30 // some minimum size constraint. This will typically be the case if | |
| 31 // there are no constraints imposed by the underlying video driver. | |
| 32 // 3. Return an empty list if resize is not supported. | |
| 33 virtual std::list<SkISize> GetSupportedSizes(const SkISize& preferred) = 0; | |
| 34 | |
| 35 // Set the size of the desktop. |size| must be one of the sizes previously | |
| 36 // returned by |GetSupportedSizes|. Note that, since monitor configurations | |
|
Wez
2012/09/25 20:48:29
nit: Move the "since ... fly" part to the end of t
Jamie
2012/09/25 23:20:20
Done.
| |
| 37 // may change on the fly, implementations should fail gracefully if the | |
| 38 // specified size is no longer supported. | |
| 39 virtual void SetSize(const SkISize& size) = 0; | |
| 40 | |
| 41 // Restore the original desktop size. This is separate from |SetSize| | |
|
Wez
2012/09/25 20:48:29
nit: Clarify what |original| is for, e.g: "Restore
Jamie
2012/09/25 23:20:20
Done.
| |
| 42 // because some implementations may handle it differently. For example, a | |
| 43 // virtual host could ignore this call to avoid an unnecessary resize and | |
| 44 // the resulting window layout changes that might ensue. | |
| 45 virtual void RestoreSize(const SkISize& original) = 0; | |
| 46 }; | |
| 47 | |
| 48 } // namespace remoting | |
| 49 | |
| 50 #endif // REMOTING_HOST_DESKTOP_RESIZER_H_ | |
| OLD | NEW |