Commit abd7bad9 authored by Viktor Semeniuk's avatar Viktor Semeniuk Committed by Commit Bot

Changed Reauth message for Copy password.

Changed Reauth dialog message for Copy password into clipboard feature.
Added new Reauth Purpose reason.

Bug: 917337
Change-Id: If805234969a39a98b24af1816f33c88388a06b87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2061814
Commit-Queue: Viktor Semeniuk <vsemeniuk@google.com>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743012}
parent b27f87b8
...@@ -367,6 +367,9 @@ Chromium is unable to recover your settings. ...@@ -367,6 +367,9 @@ Chromium is unable to recover your settings.
<message name="IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before revealing plaintext passwords on the password page."> <message name="IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before revealing plaintext passwords on the password page.">
Chromium is trying to show passwords. Chromium is trying to show passwords.
</message> </message>
<message name="IDS_PASSWORDS_PAGE_COPY_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before copying plaintext passwords into the clipboard.">
Chromium is trying to copy passwords.
</message>
<message name="IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before exporting passwords to a file."> <message name="IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before exporting passwords to a file.">
Chromium wants to export your passwords. Chromium wants to export your passwords.
</message> </message>
...@@ -375,6 +378,9 @@ Chromium is unable to recover your settings. ...@@ -375,6 +378,9 @@ Chromium is unable to recover your settings.
<message name="IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before revealing plaintext passwords on the password page."> <message name="IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before revealing plaintext passwords on the password page.">
Chromium is trying to show passwords. Type your Windows password to allow this. Chromium is trying to show passwords. Type your Windows password to allow this.
</message> </message>
<message name="IDS_PASSWORDS_PAGE_COPY_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before copying plaintext passwords into the clipboard.">
Chromium is trying to copy passwords. Type your Windows password to allow this.
</message>
<message name="IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before exporting passwords to a file."> <message name="IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before exporting passwords to a file.">
Chromium wants to export your passwords. Type your Windows password to allow this. Chromium wants to export your passwords. Type your Windows password to allow this.
</message> </message>
......
697e5a773ff312d6fbc54e36099bda6bbcc76189
\ No newline at end of file
...@@ -378,6 +378,9 @@ Google Chrome is unable to recover your settings. ...@@ -378,6 +378,9 @@ Google Chrome is unable to recover your settings.
<message name="IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before revealing plaintext passwords on the password page."> <message name="IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before revealing plaintext passwords on the password page.">
Google Chrome is trying to show passwords. Google Chrome is trying to show passwords.
</message> </message>
<message name="IDS_PASSWORDS_PAGE_COPY_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before copying plaintext passwords into the clipbord.">
Google Chrome is trying to copy passwords.
</message>
<message name="IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before exporting passwords to a file."> <message name="IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before exporting passwords to a file.">
Google Chrome wants to export your passwords. Google Chrome wants to export your passwords.
</message> </message>
...@@ -386,6 +389,9 @@ Google Chrome is unable to recover your settings. ...@@ -386,6 +389,9 @@ Google Chrome is unable to recover your settings.
<message name="IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before revealing plaintext passwords on the password page."> <message name="IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before revealing plaintext passwords on the password page.">
Google Chrome is trying to show passwords. Type your Windows password to allow this. Google Chrome is trying to show passwords. Type your Windows password to allow this.
</message> </message>
<message name="IDS_PASSWORDS_PAGE_COPY_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before copying plaintext passwords into the clipbord.">
Google Chrome is trying to copy passwords. Type your Windows password to allow this.
</message>
<message name="IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before exporting passwords to a file."> <message name="IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT" desc="Text for the dialog box that prompts the user for their OS account password before exporting passwords to a file.">
Google Chrome wants to export your passwords. Type your Windows password to allow this. Google Chrome wants to export your passwords. Type your Windows password to allow this.
</message> </message>
......
58398e2c9151e361bad0882d348a182a94193fee
\ No newline at end of file
...@@ -205,10 +205,13 @@ void PasswordsPrivateDelegateImpl::RequestPlaintextPassword( ...@@ -205,10 +205,13 @@ void PasswordsPrivateDelegateImpl::RequestPlaintextPassword(
// exiting this method. // exiting this method.
// TODO(crbug.com/495290): Pass the native window directly to the // TODO(crbug.com/495290): Pass the native window directly to the
// reauth-handling code. // reauth-handling code.
// TODO(crbug.com/1047726): Make use of the different values for reason. // TODO(crbug.com/1047726): Handle Edit case.
web_contents_ = web_contents; web_contents_ = web_contents;
auto reauth_purpose = reason == api::passwords_private::PLAINTEXT_REASON_COPY
? password_manager::ReauthPurpose::COPY_PASSWORD
: password_manager::ReauthPurpose::VIEW_PASSWORD;
if (!password_access_authenticator_.EnsureUserIsAuthenticated( if (!password_access_authenticator_.EnsureUserIsAuthenticated(
password_manager::ReauthPurpose::VIEW_PASSWORD)) { reauth_purpose)) {
std::move(callback).Run(base::nullopt); std::move(callback).Run(base::nullopt);
return; return;
} }
......
...@@ -254,7 +254,7 @@ TEST_F(PasswordsPrivateDelegateImplTest, TestCopyPasswordCallbackResult) { ...@@ -254,7 +254,7 @@ TEST_F(PasswordsPrivateDelegateImplTest, TestCopyPasswordCallbackResult) {
MockReauthCallback callback; MockReauthCallback callback;
delegate.set_os_reauth_call(callback.Get()); delegate.set_os_reauth_call(callback.Get());
EXPECT_CALL(callback, Run(ReauthPurpose::VIEW_PASSWORD)) EXPECT_CALL(callback, Run(ReauthPurpose::COPY_PASSWORD))
.WillOnce(Return(true)); .WillOnce(Return(true));
MockPlaintextPasswordCallback password_callback; MockPlaintextPasswordCallback password_callback;
...@@ -277,7 +277,7 @@ TEST_F(PasswordsPrivateDelegateImplTest, TestCopyPasswordCallbackResultFail) { ...@@ -277,7 +277,7 @@ TEST_F(PasswordsPrivateDelegateImplTest, TestCopyPasswordCallbackResultFail) {
MockReauthCallback callback; MockReauthCallback callback;
delegate.set_os_reauth_call(callback.Get()); delegate.set_os_reauth_call(callback.Get());
EXPECT_CALL(callback, Run(ReauthPurpose::VIEW_PASSWORD)) EXPECT_CALL(callback, Run(ReauthPurpose::COPY_PASSWORD))
.WillOnce(Return(false)); .WillOnce(Return(false));
base::Time before_call = test_clipboard_->GetLastModifiedTime(); base::Time before_call = test_clipboard_->GetLastModifiedTime();
......
...@@ -33,6 +33,10 @@ bool AuthenticateUser(password_manager::ReauthPurpose purpose) { ...@@ -33,6 +33,10 @@ bool AuthenticateUser(password_manager::ReauthPurpose purpose) {
case password_manager::ReauthPurpose::VIEW_PASSWORD: case password_manager::ReauthPurpose::VIEW_PASSWORD:
prompt = l10n_util::GetNSString(IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT); prompt = l10n_util::GetNSString(IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT);
break; break;
case password_manager::ReauthPurpose::COPY_PASSWORD:
prompt =
l10n_util::GetNSString(IDS_PASSWORDS_PAGE_COPY_AUTHENTICATION_PROMPT);
break;
case password_manager::ReauthPurpose::EXPORT: case password_manager::ReauthPurpose::EXPORT:
prompt = l10n_util::GetNSString( prompt = l10n_util::GetNSString(
IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT); IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT);
......
...@@ -365,6 +365,10 @@ bool AuthenticateUserOld(gfx::NativeWindow window, ...@@ -365,6 +365,10 @@ bool AuthenticateUserOld(gfx::NativeWindow window,
password_prompt = password_prompt =
l10n_util::GetStringUTF16(IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT); l10n_util::GetStringUTF16(IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT);
break; break;
case password_manager::ReauthPurpose::COPY_PASSWORD:
password_prompt = l10n_util::GetStringUTF16(
IDS_PASSWORDS_PAGE_COPY_AUTHENTICATION_PROMPT);
break;
case password_manager::ReauthPurpose::EXPORT: case password_manager::ReauthPurpose::EXPORT:
password_prompt = l10n_util::GetStringUTF16( password_prompt = l10n_util::GetStringUTF16(
IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT); IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT);
...@@ -485,6 +489,10 @@ bool AuthenticateUserNew(gfx::NativeWindow window, ...@@ -485,6 +489,10 @@ bool AuthenticateUserNew(gfx::NativeWindow window,
password_prompt = password_prompt =
l10n_util::GetStringUTF16(IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT); l10n_util::GetStringUTF16(IDS_PASSWORDS_PAGE_AUTHENTICATION_PROMPT);
break; break;
case password_manager::ReauthPurpose::COPY_PASSWORD:
password_prompt = l10n_util::GetStringUTF16(
IDS_PASSWORDS_PAGE_COPY_AUTHENTICATION_PROMPT);
break;
case password_manager::ReauthPurpose::EXPORT: case password_manager::ReauthPurpose::EXPORT:
password_prompt = l10n_util::GetStringUTF16( password_prompt = l10n_util::GetStringUTF16(
IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT); IDS_PASSWORDS_PAGE_EXPORT_AUTHENTICATION_PROMPT);
......
...@@ -107,6 +107,7 @@ TEST_P(PasswordAccessAuthenticatorTest, Failed) { ...@@ -107,6 +107,7 @@ TEST_P(PasswordAccessAuthenticatorTest, Failed) {
INSTANTIATE_TEST_SUITE_P(, INSTANTIATE_TEST_SUITE_P(,
PasswordAccessAuthenticatorTest, PasswordAccessAuthenticatorTest,
Values(ReauthPurpose::VIEW_PASSWORD, Values(ReauthPurpose::VIEW_PASSWORD,
ReauthPurpose::COPY_PASSWORD,
ReauthPurpose::EXPORT)); ReauthPurpose::EXPORT));
} // namespace password_manager } // namespace password_manager
...@@ -10,7 +10,8 @@ namespace password_manager { ...@@ -10,7 +10,8 @@ namespace password_manager {
// The reason why the user is asked to pass a reauthentication challenge. // The reason why the user is asked to pass a reauthentication challenge.
enum class ReauthPurpose { enum class ReauthPurpose {
VIEW_PASSWORD, // A password value will be made visible on the UI VIEW_PASSWORD, // A password value will be made visible on the UI
EXPORT // Password values will be written to the filesystem without COPY_PASSWORD, // A password value will be copied into the clipboard
EXPORT, // Password values will be written to the filesystem without
// protection // protection
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment