Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / remoting / host / win / window_station_and_desktop.h
blob76fe602f26a074d2887e22fe81b592a4ad0e2d96
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.
5 #ifndef REMOTING_HOST_WIN_WINDOW_STATION_AND_DESKTOP_H_
6 #define REMOTING_HOST_WIN_WINDOW_STATION_AND_DESKTOP_H_
8 #include <windows.h>
10 #include "base/basictypes.h"
12 namespace remoting {
14 // Scoper for a pair of window station and desktop handles. Both handles are
15 // closed when the object goes out of scope.
16 class WindowStationAndDesktop {
17 public:
18 WindowStationAndDesktop();
19 ~WindowStationAndDesktop();
21 HDESK desktop() const { return desktop_; }
22 HWINSTA window_station() const { return window_station_; }
24 // Sets a new desktop handle closing the owned desktop handle if needed.
25 void SetDesktop(HDESK desktop);
27 // Sets a new window station handle closing the owned window station handle
28 // if needed.
29 void SetWindowStation(HWINSTA window_station);
31 // Swaps contents with the other WindowStationAndDesktop.
32 void Swap(WindowStationAndDesktop& other);
34 private:
35 HDESK desktop_;
36 HWINSTA window_station_;
38 DISALLOW_COPY_AND_ASSIGN(WindowStationAndDesktop);
41 } // namespace remoting
43 #endif // REMOTING_HOST_WIN_WINDOW_STATION_AND_DESKTOP_H_