Index: remoting/host/it2me/it2me_confirmation_dialog_proxy.cc |
diff --git a/remoting/host/it2me/it2me_confirmation_dialog_proxy.cc b/remoting/host/it2me/it2me_confirmation_dialog_proxy.cc |
index 82a542ca62c893e160b6c0a77dfc0b97976dfb91..d18b6b4dd85e3f53508dc9c2f05ff52800b7c454 100644 |
--- a/remoting/host/it2me/it2me_confirmation_dialog_proxy.cc |
+++ b/remoting/host/it2me/it2me_confirmation_dialog_proxy.cc |
@@ -102,10 +102,23 @@ void It2MeConfirmationDialogProxy::Show( |
remote_user_email)); |
} |
+void It2MeConfirmationDialogProxy::Cancel() { |
+ DCHECK(core_->caller_task_runner()->BelongsToCurrentThread()); |
+ |
+ if (callback_) { |
+ core_->caller_task_runner()->PostTask( |
+ FROM_HERE, base::Bind(base::ResetAndReturn(&callback_), |
+ It2MeConfirmationDialog::Result::CANCEL)); |
+ } |
+} |
+ |
void It2MeConfirmationDialogProxy::ReportResult( |
It2MeConfirmationDialog::Result result) { |
DCHECK(core_->caller_task_runner()->BelongsToCurrentThread()); |
- base::ResetAndReturn(&callback_).Run(result); |
+ |
+ if (callback_) { |
+ base::ResetAndReturn(&callback_).Run(result); |
+ } |
} |
} // namespace remoting |