Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: chrome/browser/chromeos/arc/arc_navigation_throttle.cc

Issue 2436923002: Capture http to https navigations w/ intent picker (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698