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

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

Issue 2650443002: Webapp share dialog is not closed when client end of the connection is closed (Closed)
Patch Set: Formatting cleanup Created 3 years, 11 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_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

Powered by Google App Engine
This is Rietveld 408576698