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

Unified Diff: remoting/host/it2me/it2me_host.cc

Issue 2452223002: It2Me Host changes to better support Confirmation Dialog (Closed)
Patch Set: Fixing unit tests Created 4 years, 2 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
Index: remoting/host/it2me/it2me_host.cc
diff --git a/remoting/host/it2me/it2me_host.cc b/remoting/host/it2me/it2me_host.cc
index e1c7a5fea255bad73b86a8744c0a7c2cdc33a559..0f5ab20c2c54993be7caf58f2d3689c926902aec 100644
--- a/remoting/host/it2me/it2me_host.cc
+++ b/remoting/host/it2me/it2me_host.cc
@@ -404,14 +404,17 @@ void It2MeHost::SetState(It2MeHostState state,
state == kError) << state;
break;
case kReceivedAccessCode:
- DCHECK(state == kConnected ||
- state == kDisconnected ||
- state == kError) << state;
+ DCHECK(state == kConnecting || state == kDisconnected || state == kError)
+ << state;
break;
case kConnected:
DCHECK(state == kDisconnected ||
state == kError) << state;
break;
+ case kConnecting:
Sergey Ulanov 2016/10/27 22:44:12 Put kConnecting before kConnected
joedow 2016/10/31 17:16:07 Done.
+ DCHECK(state == kConnected || state == kDisconnected || state == kError)
+ << state;
+ break;
case kError:
DCHECK(state == kDisconnected) << state;
break;
@@ -430,7 +433,7 @@ void It2MeHost::SetState(It2MeHostState state,
bool It2MeHost::IsConnected() const {
Sergey Ulanov 2016/10/27 22:44:12 This doesn't look like the right name for this met
joedow 2016/10/31 17:16:07 Changed. Agreed that IsConnected is ambiguous sin
return state_ == kRequestedAccessCode || state_ == kReceivedAccessCode ||
- state_ == kConnected;
+ state_ == kConnected || state_ == kConnecting;
}
void It2MeHost::OnReceivedSupportID(
@@ -511,6 +514,9 @@ void It2MeHost::ValidateConnectionDetails(
}
}
+ HOST_LOG << "Client " << client_username << " connecting.";
+ SetState(kConnecting, std::string());
+
// Show a confirmation dialog to the user to allow them to confirm/reject it.
confirmation_dialog_proxy_.reset(new It2MeConfirmationDialogProxy(
host_context_->ui_task_runner(), std::move(confirmation_dialog_)));

Powered by Google App Engine
This is Rietveld 408576698