Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2903883002: Added NavigationContext::IsPost. (Closed)
Patch Set: Self review Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ios/web/web_state/ui/crw_web_controller.h" 5 #import "ios/web/web_state/ui/crw_web_controller.h"
6 6
7 #import <WebKit/WebKit.h> 7 #import <WebKit/WebKit.h>
8 8
9 #import <objc/runtime.h> 9 #import <objc/runtime.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 web::NavigationContextImpl::CreateNavigationContext( 1534 web::NavigationContextImpl::CreateNavigationContext(
1535 _webStateImpl, requestURL, transition); 1535 _webStateImpl, requestURL, transition);
1536 1536
1537 web::NavigationItem* item = self.navigationManagerImpl->GetPendingItem(); 1537 web::NavigationItem* item = self.navigationManagerImpl->GetPendingItem();
1538 // TODO(crbug.com/676129): AddPendingItem does not always create a pending 1538 // TODO(crbug.com/676129): AddPendingItem does not always create a pending
1539 // item. Remove this workaround once the bug is fixed. 1539 // item. Remove this workaround once the bug is fixed.
1540 if (!item) { 1540 if (!item) {
1541 item = self.navigationManagerImpl->GetLastCommittedItem(); 1541 item = self.navigationManagerImpl->GetLastCommittedItem();
1542 } 1542 }
1543 context->SetNavigationItemUniqueID(item->GetUniqueID()); 1543 context->SetNavigationItemUniqueID(item->GetUniqueID());
1544 context->SetIsPost([self isCurrentNavigationItemPOST]);
1544 _webStateImpl->SetIsLoading(true); 1545 _webStateImpl->SetIsLoading(true);
1545 _webStateImpl->OnNavigationStarted(context.get()); 1546 _webStateImpl->OnNavigationStarted(context.get());
1546 return context; 1547 return context;
1547 } 1548 }
1548 1549
1549 - (void)updateHTML5HistoryState { 1550 - (void)updateHTML5HistoryState {
1550 web::NavigationItemImpl* currentItem = self.currentNavItem; 1551 web::NavigationItemImpl* currentItem = self.currentNavItem;
1551 if (!currentItem) 1552 if (!currentItem)
1552 return; 1553 return;
1553 1554
(...skipping 3683 matching lines...) Expand 10 before | Expand all | Expand 10 after
5237 - (NSUInteger)observerCount { 5238 - (NSUInteger)observerCount {
5238 DCHECK_EQ(_observerBridges.size(), [_observers count]); 5239 DCHECK_EQ(_observerBridges.size(), [_observers count]);
5239 return [_observers count]; 5240 return [_observers count];
5240 } 5241 }
5241 5242
5242 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { 5243 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action {
5243 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; 5244 return [action.request valueForHTTPHeaderField:kReferrerHeaderName];
5244 } 5245 }
5245 5246
5246 @end 5247 @end
OLDNEW
« no previous file with comments | « ios/web/web_state/navigation_context_impl_unittest.mm ('k') | ios/web/web_state/web_state_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698