| 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/ui/autofill/autofill_client_ios.h" | 5 #import "ios/chrome/browser/ui/autofill/autofill_client_ios.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "components/autofill/core/browser/autofill_credit_card_filling_infobar_
delegate_mobile.h" |
| 11 #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_m
obile.h" | 12 #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_m
obile.h" |
| 12 #include "components/autofill/core/browser/autofill_save_card_infobar_mobile.h" | 13 #include "components/autofill/core/browser/autofill_save_card_infobar_mobile.h" |
| 13 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" | 14 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" |
| 14 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 15 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 15 #include "components/autofill/core/common/autofill_pref_names.h" | 16 #include "components/autofill/core/common/autofill_pref_names.h" |
| 16 #include "components/infobars/core/infobar.h" | 17 #include "components/infobars/core/infobar.h" |
| 17 #include "components/infobars/core/infobar_manager.h" | 18 #include "components/infobars/core/infobar_manager.h" |
| 18 #include "components/keyed_service/core/service_access_type.h" | 19 #include "components/keyed_service/core/service_access_type.h" |
| 19 #include "components/password_manager/core/browser/password_generation_manager.h
" | 20 #include "components/password_manager/core/browser/password_generation_manager.h
" |
| 20 #include "components/prefs/pref_service.h" | 21 #include "components/prefs/pref_service.h" |
| 21 #include "google_apis/gaia/identity_provider.h" | 22 #include "google_apis/gaia/identity_provider.h" |
| 22 #include "ios/chrome/browser/application_context.h" | 23 #include "ios/chrome/browser/application_context.h" |
| 23 #include "ios/chrome/browser/autofill/personal_data_manager_factory.h" | 24 #include "ios/chrome/browser/autofill/personal_data_manager_factory.h" |
| 24 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 25 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 26 #include "ios/chrome/browser/infobars/infobar_utils.h" |
| 25 #include "ios/chrome/browser/web_data_service_factory.h" | 27 #include "ios/chrome/browser/web_data_service_factory.h" |
| 26 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 28 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
| 27 | 29 |
| 28 namespace autofill { | 30 namespace autofill { |
| 29 | 31 |
| 30 AutofillClientIOS::AutofillClientIOS( | 32 AutofillClientIOS::AutofillClientIOS( |
| 31 ios::ChromeBrowserState* browser_state, | 33 ios::ChromeBrowserState* browser_state, |
| 32 infobars::InfoBarManager* infobar_manager, | 34 infobars::InfoBarManager* infobar_manager, |
| 33 id<AutofillClientIOSBridge> bridge, | 35 id<AutofillClientIOSBridge> bridge, |
| 34 password_manager::PasswordGenerationManager* password_generation_manager, | 36 password_manager::PasswordGenerationManager* password_generation_manager, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 std::unique_ptr<base::DictionaryValue> legal_message, | 107 std::unique_ptr<base::DictionaryValue> legal_message, |
| 106 const base::Closure& callback) { | 108 const base::Closure& callback) { |
| 107 infobar_manager_->AddInfoBar(CreateSaveCardInfoBarMobile( | 109 infobar_manager_->AddInfoBar(CreateSaveCardInfoBarMobile( |
| 108 base::WrapUnique(new AutofillSaveCardInfoBarDelegateMobile( | 110 base::WrapUnique(new AutofillSaveCardInfoBarDelegateMobile( |
| 109 true, card, std::move(legal_message), callback)))); | 111 true, card, std::move(legal_message), callback)))); |
| 110 } | 112 } |
| 111 | 113 |
| 112 void AutofillClientIOS::ConfirmCreditCardFillAssist( | 114 void AutofillClientIOS::ConfirmCreditCardFillAssist( |
| 113 const CreditCard& card, | 115 const CreditCard& card, |
| 114 const base::Closure& callback) { | 116 const base::Closure& callback) { |
| 115 NOTREACHED(); | 117 auto infobar_delegate = |
| 118 base::MakeUnique<AutofillCreditCardFillingInfoBarDelegateMobile>( |
| 119 card, callback); |
| 120 auto* raw_delegate = infobar_delegate.get(); |
| 121 if (infobar_manager_->AddInfoBar( |
| 122 ::CreateConfirmInfoBar(std::move(infobar_delegate)))) { |
| 123 raw_delegate->set_was_shown(); |
| 124 } |
| 116 } | 125 } |
| 117 | 126 |
| 118 void AutofillClientIOS::LoadRiskData( | 127 void AutofillClientIOS::LoadRiskData( |
| 119 const base::Callback<void(const std::string&)>& callback) { | 128 const base::Callback<void(const std::string&)>& callback) { |
| 120 callback.Run(ios::GetChromeBrowserProvider()->GetRiskData()); | 129 callback.Run(ios::GetChromeBrowserProvider()->GetRiskData()); |
| 121 } | 130 } |
| 122 | 131 |
| 123 bool AutofillClientIOS::HasCreditCardScanFeature() { | 132 bool AutofillClientIOS::HasCreditCardScanFeature() { |
| 124 return false; | 133 return false; |
| 125 } | 134 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 192 |
| 184 bool AutofillClientIOS::ShouldShowSigninPromo() { | 193 bool AutofillClientIOS::ShouldShowSigninPromo() { |
| 185 return false; | 194 return false; |
| 186 } | 195 } |
| 187 | 196 |
| 188 void AutofillClientIOS::StartSigninFlow() { | 197 void AutofillClientIOS::StartSigninFlow() { |
| 189 NOTIMPLEMENTED(); | 198 NOTIMPLEMENTED(); |
| 190 } | 199 } |
| 191 | 200 |
| 192 } // namespace autofill | 201 } // namespace autofill |
| OLD | NEW |