Chromium Code Reviews| Index: content/browser/frame_host/navigation_handle_impl.cc |
| diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc |
| index f24999058b5f36021c507f91087d45f01b5435a8..9cdc2f13f5158419b2a26cdf06824d71ae8a3712 100644 |
| --- a/content/browser/frame_host/navigation_handle_impl.cc |
| +++ b/content/browser/frame_host/navigation_handle_impl.cc |
| @@ -25,6 +25,7 @@ NavigationHandleImpl::NavigationHandleImpl(const GURL& url, |
| net_error_code_(net::OK), |
| state_(DID_START), |
| is_main_frame_(is_main_frame), |
| + is_same_page_(false), |
| is_transferring_(false), |
| delegate_(delegate) { |
| delegate_->DidStartNavigation(this); |
| @@ -46,6 +47,13 @@ bool NavigationHandleImpl::IsInMainFrame() const { |
| return is_main_frame_; |
| } |
| +bool NavigationHandleImpl::IsSamePage() { |
| + CHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE) |
|
Alexei Svitkine (slow)
2015/09/18 16:38:25
I think this should be a DCHECK(). CHECK() should
|
| + << "This accessor should not be called before the navigation has " |
| + "committed."; |
| + return is_same_page_; |
| +} |
| + |
| bool NavigationHandleImpl::HasCommittedDocument() const { |
| return state_ == DID_COMMIT; |
| } |
| @@ -59,7 +67,8 @@ void NavigationHandleImpl::DidRedirectNavigation(const GURL& new_url) { |
| delegate_->DidRedirectNavigation(this); |
| } |
| -void NavigationHandleImpl::DidCommitNavigation() { |
| +void NavigationHandleImpl::DidCommitNavigation(bool same_page) { |
| + is_same_page_ = same_page; |
| state_ = net_error_code_ == net::OK ? DID_COMMIT : DID_COMMIT_ERROR_PAGE; |
| delegate_->DidCommitNavigation(this); |
| } |