diff options
author | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-25 19:40:18 +0000 |
---|---|---|
committer | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-25 19:40:18 +0000 |
commit | fde2cca4351fd28d19b8fb2631484c4db845c88a (patch) | |
tree | ea35dd96f60ea7e3c94f155a984003b41c62a3bc /components | |
parent | bf80677772e183e1ce7d4c7e4900cbc410ae8358 (diff) | |
download | chromium_src-fde2cca4351fd28d19b8fb2631484c4db845c88a.zip chromium_src-fde2cca4351fd28d19b8fb2631484c4db845c88a.tar.gz chromium_src-fde2cca4351fd28d19b8fb2631484c4db845c88a.tar.bz2 |
Add SERVER_REDIRECT bit in ShouldIgnoreNavigation's transition_type parameter.
- Changed transition_type parameter type to uint32 and corresponding Java interface to long.
BUG=169549
Review URL: https://chromiumcodereview.appspot.com/12041032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178872 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-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_; |