diff options
-rw-r--r-- | components/navigation_interception/intercept_navigation_resource_throttle.cc | 13 | ||||
-rw-r--r-- | components/navigation_interception/intercept_navigation_resource_throttle.h | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/components/navigation_interception/intercept_navigation_resource_throttle.cc b/components/navigation_interception/intercept_navigation_resource_throttle.cc index 5f7c090..22f1244 100644 --- a/components/navigation_interception/intercept_navigation_resource_throttle.cc +++ b/components/navigation_interception/intercept_navigation_resource_throttle.cc @@ -79,17 +79,18 @@ InterceptNavigationResourceThrottle::~InterceptNavigationResourceThrottle() { } void InterceptNavigationResourceThrottle::WillStartRequest(bool* defer) { - *defer = CheckIfShouldIgnoreNavigation(request_->url()); + *defer = CheckIfShouldIgnoreNavigation(request_->url(), false); } void InterceptNavigationResourceThrottle::WillRedirectRequest( const GURL& new_url, bool* defer) { - *defer = CheckIfShouldIgnoreNavigation(new_url); + *defer = CheckIfShouldIgnoreNavigation(new_url, true); } bool InterceptNavigationResourceThrottle::CheckIfShouldIgnoreNavigation( - const GURL& url) { + const GURL& url, + bool is_redirect) { const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request_); if (!info) return false; @@ -107,7 +108,11 @@ bool InterceptNavigationResourceThrottle::CheckIfShouldIgnoreNavigation( params.has_user_gesture = info->HasUserGesture(); params.is_post = request_->method() == "POST"; params.transition_type = info->GetPageTransition(); - + if (is_redirect) { + uint32 transition = params.transition_type | + content::PAGE_TRANSITION_SERVER_REDIRECT; + params.transition_type = static_cast<content::PageTransition>(transition); + } BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, diff --git a/components/navigation_interception/intercept_navigation_resource_throttle.h b/components/navigation_interception/intercept_navigation_resource_throttle.h index 7bfe6fa..ee9cc41 100644 --- a/components/navigation_interception/intercept_navigation_resource_throttle.h +++ b/components/navigation_interception/intercept_navigation_resource_throttle.h @@ -48,7 +48,7 @@ class InterceptNavigationResourceThrottle : public content::ResourceThrottle { virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; private: - bool CheckIfShouldIgnoreNavigation(const GURL& url); + bool CheckIfShouldIgnoreNavigation(const GURL& url, bool is_redirect); void OnResultObtained(bool should_ignore_navigation); net::URLRequest* request_; |