| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "remoting/host/win/rdp_client_window.h" | 5 #include "remoting/host/win/rdp_client_window.h" |
| 6 | 6 |
| 7 #include <wtsdefs.h> | 7 #include <wtsdefs.h> |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 return LogOnCreateError(result); | 394 return LogOnCreateError(result); |
| 395 | 395 |
| 396 result = client_->Connect(); | 396 result = client_->Connect(); |
| 397 if (FAILED(result)) | 397 if (FAILED(result)) |
| 398 return LogOnCreateError(result); | 398 return LogOnCreateError(result); |
| 399 | 399 |
| 400 return 0; | 400 return 0; |
| 401 } | 401 } |
| 402 | 402 |
| 403 void RdpClientWindow::OnDestroy() { | 403 void RdpClientWindow::OnDestroy() { |
| 404 client_.Release(); | 404 client_.Reset(); |
| 405 client_9_.Release(); | 405 client_9_.Reset(); |
| 406 client_settings_.Release(); | 406 client_settings_.Reset(); |
| 407 apply_resolution_timer_.Stop(); | 407 apply_resolution_timer_.Stop(); |
| 408 } | 408 } |
| 409 | 409 |
| 410 HRESULT RdpClientWindow::OnAuthenticationWarningDisplayed() { | 410 HRESULT RdpClientWindow::OnAuthenticationWarningDisplayed() { |
| 411 LOG(WARNING) << "RDP: authentication warning is about to be shown."; | 411 LOG(WARNING) << "RDP: authentication warning is about to be shown."; |
| 412 | 412 |
| 413 // Hook window activation to cancel any modal UI shown by the RDP control. | 413 // Hook window activation to cancel any modal UI shown by the RDP control. |
| 414 // This does not affect creation of other instances of the RDP control on this | 414 // This does not affect creation of other instances of the RDP control on this |
| 415 // thread because the RDP control's window is hidden and is not activated. | 415 // thread because the RDP control's window is hidden and is not activated. |
| 416 window_activate_hook_ = WindowHook::Create(); | 416 window_activate_hook_ = WindowHook::Create(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 HRESULT RdpClientWindow::OnConfirmClose(VARIANT_BOOL* allow_close) { | 496 HRESULT RdpClientWindow::OnConfirmClose(VARIANT_BOOL* allow_close) { |
| 497 *allow_close = VARIANT_TRUE; | 497 *allow_close = VARIANT_TRUE; |
| 498 | 498 |
| 499 NotifyDisconnected(); | 499 NotifyDisconnected(); |
| 500 return S_OK; | 500 return S_OK; |
| 501 } | 501 } |
| 502 | 502 |
| 503 int RdpClientWindow::LogOnCreateError(HRESULT error) { | 503 int RdpClientWindow::LogOnCreateError(HRESULT error) { |
| 504 LOG(ERROR) << "RDP: failed to initiate a connection to " | 504 LOG(ERROR) << "RDP: failed to initiate a connection to " |
| 505 << server_endpoint_.ToString() << ": error=" << std::hex << error; | 505 << server_endpoint_.ToString() << ": error=" << std::hex << error; |
| 506 client_.Release(); | 506 client_.Reset(); |
| 507 client_9_.Release(); | 507 client_9_.Reset(); |
| 508 client_settings_.Release(); | 508 client_settings_.Reset(); |
| 509 return -1; | 509 return -1; |
| 510 } | 510 } |
| 511 | 511 |
| 512 void RdpClientWindow::NotifyConnected() { | 512 void RdpClientWindow::NotifyConnected() { |
| 513 if (event_handler_) { | 513 if (event_handler_) { |
| 514 event_handler_->OnConnected(); | 514 event_handler_->OnConnected(); |
| 515 } | 515 } |
| 516 } | 516 } |
| 517 | 517 |
| 518 void RdpClientWindow::NotifyDisconnected() { | 518 void RdpClientWindow::NotifyDisconnected() { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 } | 609 } |
| 610 | 610 |
| 611 // Close the window once all pending window messages are processed. | 611 // Close the window once all pending window messages are processed. |
| 612 HWND window = reinterpret_cast<HWND>(wparam); | 612 HWND window = reinterpret_cast<HWND>(wparam); |
| 613 LOG(WARNING) << "RDP: closing a window: " << std::hex << window; | 613 LOG(WARNING) << "RDP: closing a window: " << std::hex << window; |
| 614 ::PostMessage(window, WM_CLOSE, 0, 0); | 614 ::PostMessage(window, WM_CLOSE, 0, 0); |
| 615 return 0; | 615 return 0; |
| 616 } | 616 } |
| 617 | 617 |
| 618 } // namespace remoting | 618 } // namespace remoting |
| OLD | NEW |