Commit e17d3939 authored by Friedrich Horschig's avatar Friedrich Horschig Committed by Commit Bot

[Android] Linking from accessory sheet to passwords

This CL provides the native code to the "Manage passwords..." link in
the passwords accessory bottom sheet.

Bug: 853747
Change-Id: I275171b1889d3ea85e3d8c3eda7feab8eed06495
Reviewed-on: https://chromium-review.googlesource.com/1110131
Commit-Queue: Friedrich Horschig <fhorschig@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569587}
parent 3d1205ee
...@@ -5294,6 +5294,9 @@ the Bookmarks menu."> ...@@ -5294,6 +5294,9 @@ the Bookmarks menu.">
<message name="IDS_PASSWORD_MANAGER_ACCESSORY_PASSWORD_LIST_TITLE" desc="The title of a list of saved passwords for the currently visible site."> <message name="IDS_PASSWORD_MANAGER_ACCESSORY_PASSWORD_LIST_TITLE" desc="The title of a list of saved passwords for the currently visible site.">
Saved passwords for <ph name="domain">$1<ex>example.com</ex></ph> Saved passwords for <ph name="domain">$1<ex>example.com</ex></ph>
</message> </message>
<message name="IDS_PASSWORD_MANAGER_ACCESSORY_ALL_PASSWORDS_LINK" desc="The text of the link in the password sheet that opens the password management section.">
Manage passwords...
</message>
</if> </if>
<!-- Android uses custom UI for Bookmark importing --> <!-- Android uses custom UI for Bookmark importing -->
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "chrome/browser/android/preferences/preferences_launcher.h"
using autofill::PasswordForm; using autofill::PasswordForm;
using Item = PasswordAccessoryViewInterface::AccessoryItem; using Item = PasswordAccessoryViewInterface::AccessoryItem;
...@@ -103,6 +105,15 @@ void PasswordAccessoryController::OnFillingTriggered( ...@@ -103,6 +105,15 @@ void PasswordAccessoryController::OnFillingTriggered(
driver->FillIntoFocusedField(is_password, textToFill); driver->FillIntoFocusedField(is_password, textToFill);
} }
void PasswordAccessoryController::OnOptionSelected(
const base::string16& selectedOption) const {
if (selectedOption ==
l10n_util::GetStringUTF16(
IDS_PASSWORD_MANAGER_ACCESSORY_ALL_PASSWORDS_LINK)) {
chrome::android::PreferencesLauncher::ShowPasswordSettings();
}
}
gfx::NativeView PasswordAccessoryController::container_view() const { gfx::NativeView PasswordAccessoryController::container_view() const {
return web_contents_->GetNativeView(); return web_contents_->GetNativeView();
} }
...@@ -54,6 +54,9 @@ class PasswordAccessoryController ...@@ -54,6 +54,9 @@ class PasswordAccessoryController
void OnFillingTriggered(bool is_password, void OnFillingTriggered(bool is_password,
const base::string16& textToFill) const; const base::string16& textToFill) const;
// Called by the UI code because a user triggered the |selectedOption|.
void OnOptionSelected(const base::string16& selectedOption) const;
// The web page view containing the focused field. // The web page view containing the focused field.
gfx::NativeView container_view() const; gfx::NativeView container_view() const;
......
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