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

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

Issue 2899193003: Fixed isCurrentNavigationItemPOST for user initiated POSTs. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 _webStateImpl->OnTitleChanged(); 1389 _webStateImpl->OnTitleChanged();
1390 } 1390 }
1391 1391
1392 - (BOOL)isCurrentNavigationItemPOST { 1392 - (BOOL)isCurrentNavigationItemPOST {
1393 // |_pendingNavigationInfo| will be nil if the decidePolicy* delegate methods 1393 // |_pendingNavigationInfo| will be nil if the decidePolicy* delegate methods
1394 // were not called. 1394 // were not called.
1395 NSString* HTTPMethod = 1395 NSString* HTTPMethod =
1396 _pendingNavigationInfo 1396 _pendingNavigationInfo
1397 ? [_pendingNavigationInfo HTTPMethod] 1397 ? [_pendingNavigationInfo HTTPMethod]
1398 : [self currentBackForwardListItemHolder]->http_method(); 1398 : [self currentBackForwardListItemHolder]->http_method();
1399 return [HTTPMethod isEqual:@"POST"]; 1399 return [HTTPMethod isEqual:@"POST"] || self.currentNavItem->HasPostData();
1400 } 1400 }
1401 1401
1402 - (BOOL)isCurrentNavigationBackForward { 1402 - (BOOL)isCurrentNavigationBackForward {
1403 if (!self.currentNavItem) 1403 if (!self.currentNavItem)
1404 return NO; 1404 return NO;
1405 WKNavigationType currentNavigationType = 1405 WKNavigationType currentNavigationType =
1406 [self currentBackForwardListItemHolder]->navigation_type(); 1406 [self currentBackForwardListItemHolder]->navigation_type();
1407 return currentNavigationType == WKNavigationTypeBackForward; 1407 return currentNavigationType == WKNavigationTypeBackForward;
1408 } 1408 }
1409 1409
(...skipping 3824 matching lines...) Expand 10 before | Expand all | Expand 10 after
5234 - (NSUInteger)observerCount { 5234 - (NSUInteger)observerCount {
5235 DCHECK_EQ(_observerBridges.size(), [_observers count]); 5235 DCHECK_EQ(_observerBridges.size(), [_observers count]);
5236 return [_observers count]; 5236 return [_observers count];
5237 } 5237 }
5238 5238
5239 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { 5239 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action {
5240 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; 5240 return [action.request valueForHTTPHeaderField:kReferrerHeaderName];
5241 } 5241 }
5242 5242
5243 @end 5243 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698