| Index: chrome/browser/chromeos/arc/arc_navigation_throttle.cc
|
| diff --git a/chrome/browser/chromeos/arc/arc_navigation_throttle.cc b/chrome/browser/chromeos/arc/arc_navigation_throttle.cc
|
| index 3e3a3abe8a00cdb53d13b0997a9b216add21a3dc..2fd1e00c838cffb3b4b5c7c84a34aa6e23ff06ea 100644
|
| --- a/chrome/browser/chromeos/arc/arc_navigation_throttle.cc
|
| +++ b/chrome/browser/chromeos/arc/arc_navigation_throttle.cc
|
| @@ -13,6 +13,7 @@
|
| #include "components/arc/intent_helper/arc_intent_helper_bridge.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/navigation_handle.h"
|
| +#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
|
|
| namespace arc {
|
|
|
| @@ -65,6 +66,9 @@ ArcNavigationThrottle::WillStartRequest() {
|
| if (!navigation_handle()->HasUserGesture())
|
| return content::NavigationThrottle::PROCEED;
|
|
|
| + if (!ShouldOverrideUrlLoading(navigation_handle()))
|
| + return content::NavigationThrottle::PROCEED;
|
| +
|
| const GURL& url = navigation_handle()->GetURL();
|
| mojom::IntentHelperInstance* bridge_instance = GetIntentHelper();
|
| if (!bridge_instance)
|
| @@ -207,4 +211,15 @@ void ArcNavigationThrottle::OnDisambigDialogClosed(
|
| static_cast<int>(CloseReason::SIZE));
|
| }
|
|
|
| +bool ArcNavigationThrottle::ShouldOverrideUrlLoading(
|
| + content::NavigationHandle* navigation_handle) {
|
| + GURL previous_url = navigation_handle->GetReferrer().url;
|
| + GURL current_url = navigation_handle->GetURL();
|
| + if (net::registry_controlled_domains::SameDomainOrHost(
|
| + current_url, previous_url,
|
| + net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES))
|
| + return false;
|
| + return true;
|
| +}
|
| +
|
| } // namespace arc
|
|
|