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

Side by Side Diff: ios/chrome/browser/autofill/form_input_accessory_view_controller.mm

Issue 1079693002: Complete WebStateObserverBridge and follow Cocoa naming style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698