This source file includes following definitions.
- Start
- ContinueSession
- DisconnectSession
- OnSessionExpired
#include "remoting/host/continue_window.h"
#include "base/location.h"
#include "remoting/host/client_session_control.h"
const int kSessionExpirationTimeoutMinutes = 10;
const int kSessionDisconnectTimeoutMinutes = 1;
namespace remoting {
ContinueWindow::~ContinueWindow() {
}
void ContinueWindow::Start(
const base::WeakPtr<ClientSessionControl>& client_session_control) {
DCHECK(CalledOnValidThread());
DCHECK(!client_session_control_.get());
DCHECK(client_session_control.get());
client_session_control_ = client_session_control;
session_expired_timer_.Start(
FROM_HERE, base::TimeDelta::FromMinutes(kSessionExpirationTimeoutMinutes),
this, &ContinueWindow::OnSessionExpired);
}
void ContinueWindow::ContinueSession() {
DCHECK(CalledOnValidThread());
disconnect_timer_.Stop();
if (!client_session_control_.get())
return;
HideUi();
client_session_control_->SetDisableInputs(false);
session_expired_timer_.Start(
FROM_HERE, base::TimeDelta::FromMinutes(kSessionExpirationTimeoutMinutes),
this, &ContinueWindow::OnSessionExpired);
}
void ContinueWindow::DisconnectSession() {
DCHECK(CalledOnValidThread());
disconnect_timer_.Stop();
if (client_session_control_.get())
client_session_control_->DisconnectSession();
}
ContinueWindow::ContinueWindow() {
}
void ContinueWindow::OnSessionExpired() {
DCHECK(CalledOnValidThread());
if (!client_session_control_.get())
return;
client_session_control_->SetDisableInputs(true);
ShowUi();
disconnect_timer_.Start(
FROM_HERE, base::TimeDelta::FromMinutes(kSessionDisconnectTimeoutMinutes),
this, &ContinueWindow::DisconnectSession);
}
}