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 #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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | |
12 #include "base/time.h" | |
11 #include "remoting/host/screen_controls.h" | 13 #include "remoting/host/screen_controls.h" |
14 #include "remoting/host/screen_resolution.h" | |
12 #include "third_party/skia/include/core/SkSize.h" | 15 #include "third_party/skia/include/core/SkSize.h" |
13 | 16 |
14 namespace remoting { | 17 namespace remoting { |
15 | 18 |
16 class DesktopResizer; | 19 class DesktopResizer; |
17 class ScreenResolution; | |
18 | 20 |
19 // TODO(alexeypa): Rename this class to reflect that it is not | 21 // TODO(alexeypa): Rename this class to reflect that it is not |
20 // HostStatusObserver any more. | 22 // HostStatusObserver any more. |
21 | 23 |
22 // Uses the specified DesktopResizer to match host desktop size to the client | 24 // Uses the specified DesktopResizer to match host desktop size to the client |
23 // view size as closely as is possible. When the connection closes, restores | 25 // view size as closely as is possible. When the connection closes, restores |
24 // the original desktop size. | 26 // the original desktop size. |
25 class ResizingHostObserver : public ScreenControls { | 27 class ResizingHostObserver : public ScreenControls { |
26 public: | 28 public: |
27 explicit ResizingHostObserver(scoped_ptr<DesktopResizer> desktop_resizer); | 29 explicit ResizingHostObserver(scoped_ptr<DesktopResizer> desktop_resizer); |
28 virtual ~ResizingHostObserver(); | 30 virtual ~ResizingHostObserver(); |
29 | 31 |
30 // ScreenControls interface. | 32 // ScreenControls interface. |
31 virtual void SetScreenResolution(const ScreenResolution& resolution) OVERRIDE; | 33 virtual void SetScreenResolution(const ScreenResolution& resolution) OVERRIDE; |
32 | 34 |
33 private: | 35 private: |
36 void SetPendingScreenResolution(); | |
37 | |
34 scoped_ptr<DesktopResizer> desktop_resizer_; | 38 scoped_ptr<DesktopResizer> desktop_resizer_; |
35 SkISize original_size_; | 39 SkISize original_size_; |
36 | 40 |
41 ScreenResolution pending_resolution_; | |
alexeypa (please no reviews)
2013/06/04 00:05:26
nit: Add comments explaining what these members ar
Jamie
2013/06/04 01:27:49
Done.
| |
42 base::Time previous_resize_time_; | |
43 bool resize_pending_; | |
44 | |
45 base::WeakPtrFactory<ResizingHostObserver> weak_factory_; | |
46 | |
37 DISALLOW_COPY_AND_ASSIGN(ResizingHostObserver); | 47 DISALLOW_COPY_AND_ASSIGN(ResizingHostObserver); |
38 }; | 48 }; |
39 | 49 |
40 } // namespace remoting | 50 } // namespace remoting |
41 | 51 |
42 #endif // REMOTING_HOST_RESIZING_HOST_OBSERVER_H_ | 52 #endif // REMOTING_HOST_RESIZING_HOST_OBSERVER_H_ |
OLD | NEW |