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 |
521 confirmation_dialog_proxy_.reset(new It2MeConfirmationDialogProxy( | 527 confirmation_dialog_proxy_.reset(new It2MeConfirmationDialogProxy( |
522 host_context_->ui_task_runner(), std::move(confirmation_dialog))); | 528 host_context_->ui_task_runner(), std::move(confirmation_dialog))); |
523 | 529 |
524 confirmation_dialog_proxy_->Show( | 530 confirmation_dialog_proxy_->Show( |
525 client_username, base::Bind(&It2MeHost::OnConfirmationResult, | 531 client_username, base::Bind(&It2MeHost::OnConfirmationResult, |
526 base::Unretained(this), result_callback)); | 532 base::Unretained(this), result_callback)); |
527 } | 533 } |
528 | 534 |
529 void It2MeHost::OnConfirmationResult( | 535 void It2MeHost::OnConfirmationResult( |
530 const protocol::ValidatingAuthenticator::ResultCallback& result_callback, | 536 const protocol::ValidatingAuthenticator::ResultCallback& result_callback, |
(...skipping 24 matching lines...) Expand all Loading... |
555 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( | 561 std::unique_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( |
556 new It2MeConfirmationDialogFactory()); | 562 new It2MeConfirmationDialogFactory()); |
557 std::unique_ptr<PolicyWatcher> policy_watcher = | 563 std::unique_ptr<PolicyWatcher> policy_watcher = |
558 PolicyWatcher::Create(policy_service, context->file_task_runner()); | 564 PolicyWatcher::Create(policy_service, context->file_task_runner()); |
559 return new It2MeHost(std::move(context), std::move(policy_watcher), | 565 return new It2MeHost(std::move(context), std::move(policy_watcher), |
560 std::move(confirmation_dialog_factory), observer, | 566 std::move(confirmation_dialog_factory), observer, |
561 xmpp_server_config, directory_bot_jid); | 567 xmpp_server_config, directory_bot_jid); |
562 } | 568 } |
563 | 569 |
564 } // namespace remoting | 570 } // namespace remoting |
OLD | NEW |