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

Side by Side Diff: remoting/host/resizing_host_observer.h

Issue 12386035: Moving host status events monitoring to a separate interface (HostStatusMonitor). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/host/resizing_host_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef REMOTING_HOST_RESIZING_HOST_OBSERVER_H_ 5 #ifndef REMOTING_HOST_RESIZING_HOST_OBSERVER_H_
6 #define REMOTING_HOST_RESIZING_HOST_OBSERVER_H_ 6 #define REMOTING_HOST_RESIZING_HOST_OBSERVER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "remoting/host/host_status_observer.h"
11 #include "remoting/host/chromoting_host.h"
12
13 #include "base/basictypes.h" 10 #include "base/basictypes.h"
14 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/weak_ptr.h"
13 #include "remoting/host/host_status_observer.h"
15 #include "third_party/skia/include/core/SkSize.h" 14 #include "third_party/skia/include/core/SkSize.h"
16 15
17 namespace remoting { 16 namespace remoting {
18 17
19 class DesktopResizer; 18 class DesktopResizer;
19 class HostStatusMonitor;
20 20
21 // Use the specified DesktopResizer to match host desktop size to the client 21 // Use the specified DesktopResizer to match host desktop size to the client
22 // view size as closely as is possible. When the connection closes, restore 22 // view size as closely as is possible. When the connection closes, restore
23 // the original desktop size. 23 // the original desktop size.
24 class ResizingHostObserver : public HostStatusObserver { 24 class ResizingHostObserver : public HostStatusObserver {
25 public: 25 public:
26 ResizingHostObserver(DesktopResizer* desktop_resizer, ChromotingHost* host); 26 ResizingHostObserver(DesktopResizer* desktop_resizer,
27 base::WeakPtr<HostStatusMonitor> monitor);
27 virtual ~ResizingHostObserver(); 28 virtual ~ResizingHostObserver();
28 29
29 // HostStatusObserver interface 30 // HostStatusObserver interface
30 virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE; 31 virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE;
31 virtual void OnClientDisconnected(const std::string& jid) OVERRIDE; 32 virtual void OnClientDisconnected(const std::string& jid) OVERRIDE;
32 virtual void OnClientResolutionChanged(const std::string& jid, 33 virtual void OnClientResolutionChanged(const std::string& jid,
33 const SkISize& size, 34 const SkISize& size,
34 const SkIPoint& dpi) OVERRIDE; 35 const SkIPoint& dpi) OVERRIDE;
35 36
36 private: 37 private:
37 DesktopResizer* const desktop_resizer_; 38 DesktopResizer* const desktop_resizer_;
38 scoped_refptr<ChromotingHost> host_; 39 base::WeakPtr<HostStatusMonitor> monitor_;
39 SkISize original_size_; 40 SkISize original_size_;
40 std::string client_jid_; 41 std::string client_jid_;
41 42
42 DISALLOW_COPY_AND_ASSIGN(ResizingHostObserver); 43 DISALLOW_COPY_AND_ASSIGN(ResizingHostObserver);
43 }; 44 };
44 45
45 } // namespace remoting 46 } // namespace remoting
46 47
47 #endif // REMOTING_HOST_RESIZING_HOST_OBSERVER_H_ 48 #endif // REMOTING_HOST_RESIZING_HOST_OBSERVER_H_
OLDNEW
« 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