Index: remoting/host/desktop_resizer.h |
diff --git a/remoting/host/desktop_resizer.h b/remoting/host/desktop_resizer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..42e4ba0c7786ce33620f38bfe3ec1012db9b66d9 |
--- /dev/null |
+++ b/remoting/host/desktop_resizer.h |
@@ -0,0 +1,50 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef REMOTING_HOST_DESKTOP_RESIZER_H_ |
+#define REMOTING_HOST_DESKTOP_RESIZER_H_ |
+ |
+#include <list> |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "third_party/skia/include/core/SkRect.h" |
+ |
+namespace remoting { |
+ |
+class DesktopResizer { |
+ public: |
+ virtual ~DesktopResizer() {} |
+ |
+ // Create a platform-specific DesktopResizer instance. |
+ static scoped_ptr<DesktopResizer> Create(); |
+ |
+ // 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
|
+ virtual SkISize GetCurrentSize() = 0; |
+ |
+ // Get the list of supported sizes, which should ideally include |preferred|. |
+ // Implementations will generally do one of the following: |
+ // 1. Return the list of sizes supported by the underlying video driver, |
+ // regardless of |preferred|. |
+ // 2. Return a list containing just |preferred|, perhaps after imposing |
+ // some minimum size constraint. This will typically be the case if |
+ // there are no constraints imposed by the underlying video driver. |
+ // 3. Return an empty list if resize is not supported. |
+ virtual std::list<SkISize> GetSupportedSizes(const SkISize& preferred) = 0; |
+ |
+ // Set the size of the desktop. |size| must be one of the sizes previously |
+ // 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.
|
+ // may change on the fly, implementations should fail gracefully if the |
+ // specified size is no longer supported. |
+ virtual void SetSize(const SkISize& size) = 0; |
+ |
+ // 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.
|
+ // because some implementations may handle it differently. For example, a |
+ // virtual host could ignore this call to avoid an unnecessary resize and |
+ // the resulting window layout changes that might ensue. |
+ virtual void RestoreSize(const SkISize& original) = 0; |
+}; |
+ |
+} // namespace remoting |
+ |
+#endif // REMOTING_HOST_DESKTOP_RESIZER_H_ |