Chromium Code Reviews| Index: remoting/host/it2me/it2me_confirmation_dialog_chromeos.cc |
| diff --git a/remoting/host/it2me/it2me_confirmation_dialog_chromeos.cc b/remoting/host/it2me/it2me_confirmation_dialog_chromeos.cc |
| index eecdc2ffd4344ee6fe527114e28639d82005444b..bea82b222160d7a53dc216c7e0e3ff0ea0049590 100644 |
| --- a/remoting/host/it2me/it2me_confirmation_dialog_chromeos.cc |
| +++ b/remoting/host/it2me/it2me_confirmation_dialog_chromeos.cc |
| @@ -2,13 +2,15 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include <memory> |
| +#include <string> |
| + |
| #include "base/bind.h" |
| +#include "base/callback.h" |
| #include "base/callback_helpers.h" |
| -#include "base/location.h" |
| +#include "base/i18n/message_formatter.h" |
| #include "base/macros.h" |
| -#include "base/memory/weak_ptr.h" |
| -#include "base/single_thread_task_runner.h" |
| -#include "base/threading/thread_task_runner_handle.h" |
| +#include "base/strings/utf_string_conversions.h" |
| #include "remoting/base/string_resources.h" |
| #include "remoting/host/chromeos/message_box.h" |
| #include "remoting/host/it2me/it2me_confirmation_dialog.h" |
| @@ -22,7 +24,8 @@ class It2MeConfirmationDialogChromeOS : public It2MeConfirmationDialog { |
| ~It2MeConfirmationDialogChromeOS() override; |
| // It2MeConfirmationDialog implementation. |
| - void Show(const ResultCallback& callback) override; |
| + void Show(const std::string& remote_user_email, |
| + const ResultCallback& callback) override; |
| private: |
| // Handles result from |message_box_|. |
| @@ -38,12 +41,23 @@ It2MeConfirmationDialogChromeOS::It2MeConfirmationDialogChromeOS() {} |
| It2MeConfirmationDialogChromeOS::~It2MeConfirmationDialogChromeOS() {} |
| -void It2MeConfirmationDialogChromeOS::Show(const ResultCallback& callback) { |
| +void It2MeConfirmationDialogChromeOS::Show(const std::string& remote_user_email, |
| + const ResultCallback& callback) { |
| callback_ = callback; |
| + base::string16 dialog_message; |
| + if (!remote_user_email.empty()) { |
|
Sergey Ulanov
2016/09/09 18:46:57
maybe add a TODO to remove the case when email is
joedow
2016/09/10 02:50:36
I added this code in case we did not receive an em
|
| + dialog_message = base::i18n::MessageFormatter::FormatWithNumberedArgs( |
| + l10n_util::GetStringUTF16( |
| + IDS_SHARE_CONFIRM_DIALOG_MESSAGE_WITH_USERNAME), |
| + base::UTF8ToUTF16(remote_user_email)); |
| + } else { |
| + dialog_message = |
| + l10n_util::GetStringUTF16(IDS_SHARE_CONFIRM_DIALOG_MESSAGE); |
| + } |
| + |
| message_box_.reset(new MessageBox( |
| - l10n_util::GetStringUTF16(IDS_MODE_IT2ME), |
| - l10n_util::GetStringUTF16(IDS_SHARE_CONFIRM_DIALOG_MESSAGE), |
| + l10n_util::GetStringUTF16(IDS_MODE_IT2ME), dialog_message, |
| l10n_util::GetStringUTF16(IDS_SHARE_CONFIRM_DIALOG_CONFIRM), |
| l10n_util::GetStringUTF16(IDS_SHARE_CONFIRM_DIALOG_DECLINE), |
| base::Bind(&It2MeConfirmationDialogChromeOS::OnMessageBoxResult, |