Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: remoting/host/resizing_host_observer.h

Issue 10918224: Cross-platform plumbing for resize-to-client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed typo. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/host/resizing_host_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/resizing_host_observer.h
diff --git a/remoting/host/resizing_host_observer.h b/remoting/host/resizing_host_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..cdafa89a48c492d795068a8792cfe795fe294bfd
--- /dev/null
+++ b/remoting/host/resizing_host_observer.h
@@ -0,0 +1,48 @@
+// 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_RESIZING_HOST_OBSERVER_H_
+#define REMOTING_HOST_RESIZING_HOST_OBSERVER_H_
+
+#include <string>
+
+#include "remoting/host/host_status_observer.h"
+#include "remoting/host/chromoting_host.h"
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "third_party/skia/include/core/SkSize.h"
+
+namespace remoting {
+
+class DesktopResizer;
+
+// Use the specified DesktopResizer to match host desktop size to the client
+// view size as closely as is possible. When the connection closes, restore
+// the original desktop size.
+class ResizingHostObserver : public HostStatusObserver {
+ public:
+ explicit ResizingHostObserver(DesktopResizer* desktop_resizer,
+ ChromotingHost* host);
+ virtual ~ResizingHostObserver();
+
+ // HostStatusObserver interface
+ virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE;
+ virtual void OnClientDisconnected(const std::string& jid) OVERRIDE;
+ virtual void OnClientDimensionsChanged(const std::string& jid,
+ const SkISize& size) OVERRIDE;
+
+ private:
+ DesktopResizer* desktop_resizer_;
+ scoped_refptr<ChromotingHost> host_;
+ SkISize original_size_;
+ SkISize previous_size_;
+ std::string client_jid_;
+
+ DISALLOW_COPY_AND_ASSIGN(ResizingHostObserver);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_RESIZING_HOST_OBSERVER_H_
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/host/resizing_host_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698