| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #import <UIKit/UIKit.h> | 5 #import <UIKit/UIKit.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 DCHECK_EQ(tab_.get().webState, web_state_impl_); | 230 DCHECK_EQ(tab_.get().webState, web_state_impl_); |
| 231 | 231 |
| 232 [tab_ webWillAddPendingURL:userUrl transition:ui::PAGE_TRANSITION_TYPED]; | 232 [tab_ webWillAddPendingURL:userUrl transition:ui::PAGE_TRANSITION_TYPED]; |
| 233 web_state_impl_->OnProvisionalNavigationStarted(userUrl); | 233 web_state_impl_->OnProvisionalNavigationStarted(userUrl); |
| 234 [tab_ webWillAddPendingURL:redirectUrl | 234 [tab_ webWillAddPendingURL:redirectUrl |
| 235 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT]; | 235 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT]; |
| 236 | 236 |
| 237 web::Referrer empty_referrer; | 237 web::Referrer empty_referrer; |
| 238 [tab_ navigationManagerImpl]->AddPendingItem( | 238 [tab_ navigationManagerImpl]->AddPendingItem( |
| 239 redirectUrl, empty_referrer, ui::PAGE_TRANSITION_CLIENT_REDIRECT, | 239 redirectUrl, empty_referrer, ui::PAGE_TRANSITION_CLIENT_REDIRECT, |
| 240 web::NavigationInitiationType::RENDERER_INITIATED); | 240 web::NavigationInitiationType::RENDERER_INITIATED, |
| 241 web::NavigationManager::UserAgentOverrideOption::INHERIT); |
| 241 | 242 |
| 242 web_state_impl_->OnProvisionalNavigationStarted(redirectUrl); | 243 web_state_impl_->OnProvisionalNavigationStarted(redirectUrl); |
| 243 [[tab_ navigationManagerImpl]->GetSessionController() commitPendingItem]; | 244 [[tab_ navigationManagerImpl]->GetSessionController() commitPendingItem]; |
| 244 [[tab_ webController] webStateImpl]->UpdateHttpResponseHeaders(redirectUrl); | 245 [[tab_ webController] webStateImpl]->UpdateHttpResponseHeaders(redirectUrl); |
| 245 [[tab_ webController] webStateImpl]->OnNavigationCommitted(redirectUrl); | 246 [[tab_ webController] webStateImpl]->OnNavigationCommitted(redirectUrl); |
| 246 | 247 |
| 247 base::string16 new_title = base::SysNSStringToUTF16(title); | 248 base::string16 new_title = base::SysNSStringToUTF16(title); |
| 248 [tab_ navigationManager]->GetLastCommittedItem()->SetTitle(new_title); | 249 [tab_ navigationManager]->GetLastCommittedItem()->SetTitle(new_title); |
| 249 | 250 |
| 250 web_state_impl_->OnTitleChanged(); | 251 web_state_impl_->OnTitleChanged(); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 [[FakeNativeAppMetadata alloc] init]); | 552 [[FakeNativeAppMetadata alloc] init]); |
| 552 | 553 |
| 553 // Turn auto open on. | 554 // Turn auto open on. |
| 554 [metadata setShouldAutoOpenLinks:YES]; | 555 [metadata setShouldAutoOpenLinks:YES]; |
| 555 int expectedCallCount = 2; | 556 int expectedCallCount = 2; |
| 556 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); | 557 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); |
| 557 EXPECT_FALSE([metadata shouldAutoOpenLinks]); | 558 EXPECT_FALSE([metadata shouldAutoOpenLinks]); |
| 558 } | 559 } |
| 559 | 560 |
| 560 } // namespace | 561 } // namespace |
| OLD | NEW |