| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/autofill_controller.h" | 5 #import "ios/chrome/browser/autofill/autofill_controller.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 InfoBarManagerImpl::FromWebState(webState); | 69 InfoBarManagerImpl::FromWebState(webState); |
| 70 DCHECK(infobarManager); | 70 DCHECK(infobarManager); |
| 71 ios::ChromeBrowserState* originalBrowserState = | 71 ios::ChromeBrowserState* originalBrowserState = |
| 72 browserState->GetOriginalChromeBrowserState(); | 72 browserState->GetOriginalChromeBrowserState(); |
| 73 std::unique_ptr<IdentityProvider> identityProvider( | 73 std::unique_ptr<IdentityProvider> identityProvider( |
| 74 new ProfileIdentityProvider( | 74 new ProfileIdentityProvider( |
| 75 ios::SigninManagerFactory::GetForBrowserState(originalBrowserState), | 75 ios::SigninManagerFactory::GetForBrowserState(originalBrowserState), |
| 76 OAuth2TokenServiceFactory::GetForBrowserState(originalBrowserState), | 76 OAuth2TokenServiceFactory::GetForBrowserState(originalBrowserState), |
| 77 base::Closure())); | 77 base::Closure())); |
| 78 _autofillClient.reset(new autofill::AutofillClientIOS( | 78 _autofillClient.reset(new autofill::AutofillClientIOS( |
| 79 browserState, infobarManager, self, passwordGenerationManager, | 79 browserState, webState, infobarManager, self, passwordGenerationManager, |
| 80 std::move(identityProvider))); | 80 std::move(identityProvider))); |
| 81 autofill::AutofillDriverIOS::CreateForWebStateAndDelegate( | 81 autofill::AutofillDriverIOS::CreateForWebStateAndDelegate( |
| 82 webState, _autofillClient.get(), self, | 82 webState, _autofillClient.get(), self, |
| 83 GetApplicationContext()->GetApplicationLocale(), | 83 GetApplicationContext()->GetApplicationLocale(), |
| 84 downloadEnabled | 84 downloadEnabled |
| 85 ? autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER | 85 ? autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER |
| 86 : autofill::AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER); | 86 : autofill::AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER); |
| 87 _autofillAgent = autofillAgent; | 87 _autofillAgent = autofillAgent; |
| 88 _autofillManager = | 88 _autofillManager = |
| 89 autofill::AutofillDriverIOS::FromWebState(webState)->autofill_manager(); | 89 autofill::AutofillDriverIOS::FromWebState(webState)->autofill_manager(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } | 191 } |
| 192 | 192 |
| 193 - (void)sendAutofillTypePredictionsToRenderer: | 193 - (void)sendAutofillTypePredictionsToRenderer: |
| 194 (const std::vector<autofill::FormStructure*>&)forms { | 194 (const std::vector<autofill::FormStructure*>&)forms { |
| 195 NSUserDefaults* standardDefaults = [NSUserDefaults standardUserDefaults]; | 195 NSUserDefaults* standardDefaults = [NSUserDefaults standardUserDefaults]; |
| 196 if ([standardDefaults boolForKey:@"ShowAutofillTypePredictions"]) | 196 if ([standardDefaults boolForKey:@"ShowAutofillTypePredictions"]) |
| 197 [_autofillAgent renderAutofillTypePredictions:forms]; | 197 [_autofillAgent renderAutofillTypePredictions:forms]; |
| 198 } | 198 } |
| 199 | 199 |
| 200 @end | 200 @end |
| OLD | NEW |