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

Unified Diff: remoting/host/scoped_thread_desktop_win.cc

Issue 10832068: Moving Windows-only files: remoting/host -> remoting/host/win. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/scoped_thread_desktop_win.h ('k') | remoting/host/session_event_executor_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/scoped_thread_desktop_win.cc
===================================================================
--- remoting/host/scoped_thread_desktop_win.cc (revision 149037)
+++ remoting/host/scoped_thread_desktop_win.cc (working copy)
@@ -1,49 +0,0 @@
-// 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.
-
-#include "remoting/host/scoped_thread_desktop_win.h"
-
-#include "base/logging.h"
-
-#include "remoting/host/desktop_win.h"
-
-namespace remoting {
-
-ScopedThreadDesktopWin::ScopedThreadDesktopWin()
- : initial_(DesktopWin::GetThreadDesktop()) {
-}
-
-ScopedThreadDesktopWin::~ScopedThreadDesktopWin() {
- Revert();
-}
-
-bool ScopedThreadDesktopWin::IsSame(const DesktopWin& desktop) {
- if (assigned_.get() != NULL) {
- return assigned_->IsSame(desktop);
- } else {
- return initial_->IsSame(desktop);
- }
-}
-
-void ScopedThreadDesktopWin::Revert() {
- if (assigned_.get() != NULL) {
- initial_->SetThreadDesktop();
- assigned_.reset();
- }
-}
-
-bool ScopedThreadDesktopWin::SetThreadDesktop(scoped_ptr<DesktopWin> desktop) {
- Revert();
-
- if (initial_->IsSame(*desktop))
- return false;
-
- if (!desktop->SetThreadDesktop())
- return false;
-
- assigned_ = desktop.Pass();
- return true;
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/host/scoped_thread_desktop_win.h ('k') | remoting/host/session_event_executor_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698