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

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

Issue 2669123003: iOS: Mark HTTP pages with credit card fields with an omnibox icon. (Closed)
Patch Set: Add CRWWebController test. Created 3 years, 10 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 4251 matching lines...) Expand 10 before | Expand all | Expand 10 after
4262 4262
4263 - (void)didShowPasswordInputOnHTTP { 4263 - (void)didShowPasswordInputOnHTTP {
4264 DCHECK(!web::IsOriginSecure(self.webState->GetLastCommittedURL())); 4264 DCHECK(!web::IsOriginSecure(self.webState->GetLastCommittedURL()));
4265 web::NavigationItem* item = 4265 web::NavigationItem* item =
4266 self.webState->GetNavigationManager()->GetLastCommittedItem(); 4266 self.webState->GetNavigationManager()->GetLastCommittedItem();
4267 item->GetSSL().content_status |= 4267 item->GetSSL().content_status |=
4268 web::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP; 4268 web::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP;
4269 [self didUpdateSSLStatusForCurrentNavigationItem]; 4269 [self didUpdateSSLStatusForCurrentNavigationItem];
4270 } 4270 }
4271 4271
4272 - (void)didShowCreditCardInputOnHTTP {
4273 DCHECK(!web::IsOriginSecure(self.webState->GetLastCommittedURL()));
4274 web::NavigationItem* item =
4275 self.webState->GetNavigationManager()->GetLastCommittedItem();
4276 item->GetSSL().content_status |=
4277 web::SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP;
4278 [self didUpdateSSLStatusForCurrentNavigationItem];
4279 }
4280
4272 - (void)handleSSLCertError:(NSError*)error { 4281 - (void)handleSSLCertError:(NSError*)error {
4273 CHECK(web::IsWKWebViewSSLCertError(error)); 4282 CHECK(web::IsWKWebViewSSLCertError(error));
4274 4283
4275 net::SSLInfo info; 4284 net::SSLInfo info;
4276 web::GetSSLInfoFromWKWebViewSSLCertError(error, &info); 4285 web::GetSSLInfoFromWKWebViewSSLCertError(error, &info);
4277 4286
4278 if (!info.cert) { 4287 if (!info.cert) {
4279 // |info.cert| can be null if certChain in NSError is empty or can not be 4288 // |info.cert| can be null if certChain in NSError is empty or can not be
4280 // parsed, in this case do not ask delegate if error should be allowed, it 4289 // parsed, in this case do not ask delegate if error should be allowed, it
4281 // should not be. 4290 // should not be.
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
5452 } 5461 }
5453 5462
5454 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 5463 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
5455 } 5464 }
5456 5465
5457 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { 5466 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action {
5458 return [action.request valueForHTTPHeaderField:@"Referer"]; 5467 return [action.request valueForHTTPHeaderField:@"Referer"];
5459 } 5468 }
5460 5469
5461 @end 5470 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698