OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/it2me/it2me_host.h" | 5 #include "remoting/host/it2me/it2me_host.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 << ": Domain mismatch."; | 511 << ": Domain mismatch."; |
512 result_callback.Run(ValidationResult::ERROR_INVALID_ACCOUNT); | 512 result_callback.Run(ValidationResult::ERROR_INVALID_ACCOUNT); |
513 return; | 513 return; |
514 } | 514 } |
515 } | 515 } |
516 | 516 |
517 // Show a confirmation dialog to the user to allow them to confirm/reject it. | 517 // Show a confirmation dialog to the user to allow them to confirm/reject it. |
518 std::unique_ptr<It2MeConfirmationDialog> confirmation_dialog = | 518 std::unique_ptr<It2MeConfirmationDialog> confirmation_dialog = |
519 confirmation_dialog_factory_->Create(); | 519 confirmation_dialog_factory_->Create(); |
520 | 520 |
521 // TODO(joedow): Remove this once confirmation dialog exists on all platforms. | |
522 if (!confirmation_dialog) { | |
523 result_callback.Run(ValidationResult::SUCCESS); | |
524 return; | |
525 } | |
526 | |
527 confirmation_dialog_proxy_.reset(new It2MeConfirmationDialogProxy( | 521 confirmation_dialog_proxy_.reset(new It2MeConfirmationDialogProxy( |
528 host_context_->ui_task_runner(), std::move(confirmation_dialog))); | 522 host_context_->ui_task_runner(), std::move(confirmation_dialog))); |
529 | 523 |
530 confirmation_dialog_proxy_->Show( | 524 confirmation_dialog_proxy_->Show( |
531 client_username, base::Bind(&It2MeHost::OnConfirmationResult, | 525 client_username, base::Bind(&It2MeHost::OnConfirmationResult, |
532 base::Unretained(this), result_callback)); | 526 base::Unretained(this), result_callback)); |
533 } | 527 } |
534 | 528 |
535 void It2MeHost::OnConfirmationResult( | 529 void It2MeHost::OnConfirmationResult( |
536 const protocol::ValidatingAuthenticator::ResultCallback& result_callback, | 530 const protocol::ValidatingAuthenticator::ResultCallback& result_callback, |
(...skipping 24 matching lines...) Expand all Loading... |
561 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( | 555 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( |
562 new It2MeConfirmationDialogFactory()); | 556 new It2MeConfirmationDialogFactory()); |
563 std::unique_ptr<PolicyWatcher> policy_watcher = | 557 std::unique_ptr<PolicyWatcher> policy_watcher = |
564 PolicyWatcher::Create(policy_service, context->file_task_runner()); | 558 PolicyWatcher::Create(policy_service, context->file_task_runner()); |
565 return new It2MeHost(std::move(context), std::move(policy_watcher), | 559 return new It2MeHost(std::move(context), std::move(policy_watcher), |
566 std::move(confirmation_dialog_factory), observer, | 560 std::move(confirmation_dialog_factory), observer, |
567 xmpp_server_config, directory_bot_jid); | 561 xmpp_server_config, directory_bot_jid); |
568 } | 562 } |
569 | 563 |
570 } // namespace remoting | 564 } // namespace remoting |
OLD | NEW |