Chromium Code Reviews| 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..fd41e629103ec58beab07bb660c20a05c9983b38 100644 |
| --- a/chrome/browser/chromeos/arc/arc_navigation_throttle.cc |
| +++ b/chrome/browser/chromeos/arc/arc_navigation_throttle.cc |
| @@ -65,6 +65,9 @@ ArcNavigationThrottle::WillStartRequest() { |
| if (!navigation_handle()->HasUserGesture()) |
| return content::NavigationThrottle::PROCEED; |
| + if (!ShouldOverrideUrlLoading()) |
| + return content::NavigationThrottle::PROCEED; |
| + |
| const GURL& url = navigation_handle()->GetURL(); |
| mojom::IntentHelperInstance* bridge_instance = GetIntentHelper(); |
| if (!bridge_instance) |
| @@ -207,4 +210,12 @@ void ArcNavigationThrottle::OnDisambigDialogClosed( |
| static_cast<int>(CloseReason::SIZE)); |
| } |
| +bool ArcNavigationThrottle::ShouldOverrideUrlLoading() { |
|
Yusuke Sato
2016/07/01 14:05:24
Is it possible to add unit tests for this?
malaykeshav
2016/07/01 23:20:41
Can be made unit testable. Just need to pass navig
|
| + std::string previous_url = navigation_handle()->GetReferrer().url.host(); |
| + std::string current_url = navigation_handle()->GetURL().host(); |
| + if (current_url == previous_url) |
|
Yusuke Sato
2016/07/01 14:05:24
I think this function should also return false whe
malaykeshav
2016/07/01 23:20:41
If we are going from mail.google.com to maps.googl
Yusuke Sato
2016/07/01 23:35:56
The original Clank code seems to properly handle s
|
| + return false; |
| + return true; |
| +} |
| + |
| } // namespace arc |