| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/web/public/test/fakes/test_web_state_observer.h" | 5 #include "ios/web/public/test/fakes/test_web_state_observer.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ios/web/public/web_state/navigation_context.h" | 8 #include "ios/web/public/web_state/navigation_context.h" |
| 9 #include "ios/web/public/web_state/web_state.h" | 9 #include "ios/web/public/web_state/web_state.h" |
| 10 #include "ios/web/web_state/navigation_context_impl.h" | 10 #include "ios/web/web_state/navigation_context_impl.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 navigation_item_changed_info_->web_state = web_state(); | 64 navigation_item_changed_info_->web_state = web_state(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void TestWebStateObserver::DidFinishNavigation(NavigationContext* context) { | 67 void TestWebStateObserver::DidFinishNavigation(NavigationContext* context) { |
| 68 did_finish_navigation_info_ = | 68 did_finish_navigation_info_ = |
| 69 base::MakeUnique<web::TestDidFinishNavigationInfo>(); | 69 base::MakeUnique<web::TestDidFinishNavigationInfo>(); |
| 70 did_finish_navigation_info_->web_state = web_state(); | 70 did_finish_navigation_info_->web_state = web_state(); |
| 71 if (context->IsSameDocument()) { | 71 if (context->IsSameDocument()) { |
| 72 ASSERT_FALSE(context->IsErrorPage()); | 72 ASSERT_FALSE(context->IsErrorPage()); |
| 73 did_finish_navigation_info_->context = | 73 did_finish_navigation_info_->context = |
| 74 NavigationContextImpl::CreateSamePageNavigationContext( | 74 NavigationContextImpl::CreateSameDocumentNavigationContext( |
| 75 context->GetWebState(), context->GetUrl()); | 75 context->GetWebState(), context->GetUrl()); |
| 76 } else if (context->IsErrorPage()) { | 76 } else if (context->IsErrorPage()) { |
| 77 ASSERT_FALSE(context->IsSameDocument()); | 77 ASSERT_FALSE(context->IsSameDocument()); |
| 78 did_finish_navigation_info_->context = | 78 did_finish_navigation_info_->context = |
| 79 NavigationContextImpl::CreateErrorPageNavigationContext( | 79 NavigationContextImpl::CreateErrorPageNavigationContext( |
| 80 context->GetWebState(), context->GetUrl()); | 80 context->GetWebState(), context->GetUrl()); |
| 81 } else { | 81 } else { |
| 82 did_finish_navigation_info_->context = | 82 did_finish_navigation_info_->context = |
| 83 NavigationContextImpl::CreateNavigationContext(context->GetWebState(), | 83 NavigationContextImpl::CreateNavigationContext(context->GetWebState(), |
| 84 context->GetUrl()); | 84 context->GetUrl()); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 start_loading_info_ = base::MakeUnique<web::TestStartLoadingInfo>(); | 150 start_loading_info_ = base::MakeUnique<web::TestStartLoadingInfo>(); |
| 151 start_loading_info_->web_state = web_state(); | 151 start_loading_info_->web_state = web_state(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void TestWebStateObserver::DidStopLoading() { | 154 void TestWebStateObserver::DidStopLoading() { |
| 155 stop_loading_info_ = base::MakeUnique<web::TestStopLoadingInfo>(); | 155 stop_loading_info_ = base::MakeUnique<web::TestStopLoadingInfo>(); |
| 156 stop_loading_info_->web_state = web_state(); | 156 stop_loading_info_->web_state = web_state(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace web | 159 } // namespace web |
| OLD | NEW |