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 d2d290b20c8664f8081e47e08077b600f870dc2a..f2b43b8ff7a05ce5d4c61a14c6b7eacd55d67628 100644 |
--- a/chrome/browser/chromeos/arc/arc_navigation_throttle.cc |
+++ b/chrome/browser/chromeos/arc/arc_navigation_throttle.cc |
@@ -119,8 +119,18 @@ ArcNavigationThrottle::HandleRequest() { |
kAllowFormSubmit)) |
return content::NavigationThrottle::PROCEED; |
- const GURL previous_url = navigation_handle()->GetReferrer().url; |
+ const GURL referrer_url = navigation_handle()->GetReferrer().url; |
const GURL current_url = navigation_handle()->GetURL(); |
+ const GURL last_committed_url = |
+ navigation_handle()->GetWebContents()->GetLastCommittedURL(); |
+ |
+ // For navigations from http to https we clean up the Referrer as part of the |
+ // sanitization proccess, however we may still have access to the last |
+ // committed URL. We don't use GetVisibleURL() since it may contains a still |
Yusuke Sato
2016/10/20 15:20:53
nit: contain?
djacobo_
2016/10/20 18:38:14
Done.
|
+ // non-committed URL (i.e. it can be the same as GetURL()). |
+ const GURL previous_url = |
+ referrer_url.is_empty() ? last_committed_url : referrer_url; |
Yusuke Sato
2016/10/20 15:20:52
qq: We still need the is_empty() check because the
djacobo_
2016/10/20 18:38:14
Correct, the navigation started with target="_blan
Yusuke Sato
2016/10/20 19:32:05
Can you mention this in the code comment?
djacobo_
2016/10/20 20:07:31
Done.
|
+ |
if (!ShouldOverrideUrlLoading(previous_url, current_url)) |
return content::NavigationThrottle::PROCEED; |