Commit 42a19bbb authored by Jonathan Mengedoht's avatar Jonathan Mengedoht Committed by Commit Bot

Add WellKnownChangePasswordNavigationThrottle to android

The NavigationThrottle validates if a site supports
.well-known/change-password urls and redirects to the origin if not to
not show the user a 404 page.
The NavigationThrottle is guarded by the WellKnownChangePassword feature
flag.

Bug: 927473
Change-Id: I4c9bf4bc61878096fbfec06cc922d1852a71fb8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2316164
Commit-Queue: Jonathan Mengedoht <mengedoht@google.com>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792230}
parent b37b3b40
...@@ -150,6 +150,7 @@ ...@@ -150,6 +150,7 @@
#include "chrome/browser/ui/login/login_handler.h" #include "chrome/browser/ui/login/login_handler.h"
#include "chrome/browser/ui/login/login_navigation_throttle.h" #include "chrome/browser/ui/login/login_navigation_throttle.h"
#include "chrome/browser/ui/login/login_tab_helper.h" #include "chrome/browser/ui/login/login_tab_helper.h"
#include "chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.h"
#include "chrome/browser/ui/prefs/pref_watcher.h" #include "chrome/browser/ui/prefs/pref_watcher.h"
#include "chrome/browser/ui/sync/sync_promo_ui.h" #include "chrome/browser/ui/sync/sync_promo_ui.h"
#include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h"
...@@ -465,7 +466,6 @@ ...@@ -465,7 +466,6 @@
#include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/passwords/google_password_manager_navigation_throttle.h" #include "chrome/browser/ui/passwords/google_password_manager_navigation_throttle.h"
#include "chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.h"
#include "chrome/browser/ui/search/new_tab_page_navigation_throttle.h" #include "chrome/browser/ui/search/new_tab_page_navigation_throttle.h"
#include "chrome/browser/webauthn/authenticator_request_scheduler.h" #include "chrome/browser/webauthn/authenticator_request_scheduler.h"
#include "chrome/browser/webauthn/chrome_authenticator_request_delegate.h" #include "chrome/browser/webauthn/chrome_authenticator_request_delegate.h"
...@@ -4045,6 +4045,10 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation( ...@@ -4045,6 +4045,10 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
MaybeAddThrottle(TabUnderNavigationThrottle::MaybeCreate(handle), &throttles); MaybeAddThrottle(TabUnderNavigationThrottle::MaybeCreate(handle), &throttles);
MaybeAddThrottle(
WellKnownChangePasswordNavigationThrottle::MaybeCreateThrottleFor(handle),
&throttles);
throttles.push_back(std::make_unique<PolicyBlocklistNavigationThrottle>( throttles.push_back(std::make_unique<PolicyBlocklistNavigationThrottle>(
handle, handle->GetWebContents()->GetBrowserContext())); handle, handle->GetWebContents()->GetBrowserContext()));
...@@ -4070,9 +4074,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation( ...@@ -4070,9 +4074,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
GooglePasswordManagerNavigationThrottle::MaybeCreateThrottleFor(handle), GooglePasswordManagerNavigationThrottle::MaybeCreateThrottleFor(handle),
&throttles); &throttles);
MaybeAddThrottle(
WellKnownChangePasswordNavigationThrottle::MaybeCreateThrottleFor(handle),
&throttles);
#endif #endif
throttles.push_back( throttles.push_back(
......
...@@ -131,6 +131,8 @@ static_library("ui") { ...@@ -131,6 +131,8 @@ static_library("ui") {
"passwords/settings/password_manager_presenter.cc", "passwords/settings/password_manager_presenter.cc",
"passwords/settings/password_manager_presenter.h", "passwords/settings/password_manager_presenter.h",
"passwords/settings/password_ui_view.h", "passwords/settings/password_ui_view.h",
"passwords/well_known_change_password_navigation_throttle.cc",
"passwords/well_known_change_password_navigation_throttle.h",
"prefs/pref_watcher.cc", "prefs/pref_watcher.cc",
"prefs/pref_watcher.h", "prefs/pref_watcher.h",
"prefs/prefs_tab_helper.cc", "prefs/prefs_tab_helper.cc",
...@@ -1105,8 +1107,6 @@ static_library("ui") { ...@@ -1105,8 +1107,6 @@ static_library("ui") {
"passwords/passwords_leak_dialog_delegate.h", "passwords/passwords_leak_dialog_delegate.h",
"passwords/passwords_model_delegate.cc", "passwords/passwords_model_delegate.cc",
"passwords/passwords_model_delegate.h", "passwords/passwords_model_delegate.h",
"passwords/well_known_change_password_navigation_throttle.cc",
"passwords/well_known_change_password_navigation_throttle.h",
"pdf/chrome_pdf_web_contents_helper_client.cc", "pdf/chrome_pdf_web_contents_helper_client.cc",
"pdf/chrome_pdf_web_contents_helper_client.h", "pdf/chrome_pdf_web_contents_helper_client.h",
"permission_bubble/permission_prompt.h", "permission_bubble/permission_prompt.h",
......
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