OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome/browser/autofill/form_input_accessory_view_controller.h" | 5 #import "ios/chrome/browser/autofill/form_input_accessory_view_controller.h" |
6 | 6 |
7 #include "base/ios/block_types.h" | 7 #include "base/ios/block_types.h" |
8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
9 #include "base/mac/scoped_block.h" | 9 #include "base/mac/scoped_block.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 (void (^)(BOOL, BOOL))completionHandler { | 355 (void (^)(BOOL, BOOL))completionHandler { |
356 DCHECK(completionHandler); | 356 DCHECK(completionHandler); |
357 [_JSSuggestionManager | 357 [_JSSuggestionManager |
358 fetchPreviousAndNextElementsPresenceWithCompletionHandler: | 358 fetchPreviousAndNextElementsPresenceWithCompletionHandler: |
359 completionHandler]; | 359 completionHandler]; |
360 } | 360 } |
361 | 361 |
362 #pragma mark - | 362 #pragma mark - |
363 #pragma mark CRWWebStateObserver | 363 #pragma mark CRWWebStateObserver |
364 | 364 |
365 - (void)pageLoaded:(web::WebState*)webState { | 365 - (void)webStateDidLoadPage:(web::WebState*)webState { |
366 [self reset]; | 366 [self reset]; |
367 } | 367 } |
368 | 368 |
369 - (void)formActivity:(web::WebState*)webState | 369 - (void)webState:(web::WebState*)webState |
370 formName:(const std::string&)formName | 370 didRegisterFormActivityWithFormNamed:(const std::string&)formName |
371 fieldName:(const std::string&)fieldName | 371 fieldName:(const std::string&)fieldName |
372 type:(const std::string&)type | 372 type:(const std::string&)type |
373 value:(const std::string&)value | 373 value:(const std::string&)value |
374 keyCode:(int)keyCode | 374 keyCode:(int)keyCode |
375 error:(BOOL)error { | 375 inputMissing:(BOOL)inputMissing { |
376 web::URLVerificationTrustLevel trustLevel; | 376 web::URLVerificationTrustLevel trustLevel; |
377 const GURL pageURL(webState->GetCurrentURL(&trustLevel)); | 377 const GURL pageURL(webState->GetCurrentURL(&trustLevel)); |
378 if (error || trustLevel != web::URLVerificationTrustLevel::kAbsolute || | 378 if (inputMissing || trustLevel != web::URLVerificationTrustLevel::kAbsolute || |
379 !web::UrlHasWebScheme(pageURL) || !webState->ContentIsHTML()) { | 379 !web::UrlHasWebScheme(pageURL) || !webState->ContentIsHTML()) { |
380 [self reset]; | 380 [self reset]; |
381 return; | 381 return; |
382 } | 382 } |
383 | 383 |
384 if ((type == "blur" || type == "change")) { | 384 if ((type == "blur" || type == "change")) { |
385 return; | 385 return; |
386 } | 386 } |
387 | 387 |
388 [self retrieveAccessoryViewForForm:formName | 388 [self retrieveAccessoryViewForForm:formName |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 } | 498 } |
499 _keyboardFrame = keyboardFrame; | 499 _keyboardFrame = keyboardFrame; |
500 [_currentProvider resizeAccessoryView]; | 500 [_currentProvider resizeAccessoryView]; |
501 } | 501 } |
502 | 502 |
503 - (void)keyboardDidHide:(NSNotification*)notification { | 503 - (void)keyboardDidHide:(NSNotification*)notification { |
504 _keyboardFrame = CGRectZero; | 504 _keyboardFrame = CGRectZero; |
505 } | 505 } |
506 | 506 |
507 @end | 507 @end |
OLD | NEW |