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 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | 5 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" | |
10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 9 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
11 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
12 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 11 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
13 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 13 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
15 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 14 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
16 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" | 15 #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" |
17 #include "chrome/browser/ui/autofill/credit_card_scanner_controller.h" | 16 #include "chrome/browser/ui/autofill/credit_card_scanner_controller.h" |
18 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_finder.h" | 18 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 FROM_HERE, base::Bind(&ChromeAutofillClient::OnVerificationFailure, | 128 FROM_HERE, base::Bind(&ChromeAutofillClient::OnVerificationFailure, |
130 weak_pointer_factory_.GetWeakPtr()), | 129 weak_pointer_factory_.GetWeakPtr()), |
131 base::TimeDelta::FromSeconds(2)); | 130 base::TimeDelta::FromSeconds(2)); |
132 } | 131 } |
133 | 132 |
134 void ChromeAutofillClient::OnVerificationFailure() { | 133 void ChromeAutofillClient::OnVerificationFailure() { |
135 if (card_unmask_view_) | 134 if (card_unmask_view_) |
136 card_unmask_view_->VerificationFailed(); | 135 card_unmask_view_->VerificationFailed(); |
137 } | 136 } |
138 | 137 |
139 void ChromeAutofillClient::ConfirmSaveCreditCard( | |
140 const base::Closure& save_card_callback) { | |
141 InfoBarService* infobar_service = | |
142 InfoBarService::FromWebContents(web_contents()); | |
143 AutofillCCInfoBarDelegate::Create(infobar_service, save_card_callback); | |
144 } | |
145 | |
146 bool ChromeAutofillClient::HasCreditCardScanFeature() { | 138 bool ChromeAutofillClient::HasCreditCardScanFeature() { |
147 return CreditCardScannerController::HasCreditCardScanFeature(); | 139 return CreditCardScannerController::HasCreditCardScanFeature(); |
148 } | 140 } |
149 | 141 |
150 void ChromeAutofillClient::ScanCreditCard( | 142 void ChromeAutofillClient::ScanCreditCard( |
151 const CreditCardScanCallback& callback) { | 143 const CreditCardScanCallback& callback) { |
152 CreditCardScannerController::ScanCreditCard(web_contents(), callback); | 144 CreditCardScannerController::ScanCreditCard(web_contents(), callback); |
153 } | 145 } |
154 | 146 |
155 void ChromeAutofillClient::ShowRequestAutocompleteDialog( | 147 void ChromeAutofillClient::ShowRequestAutocompleteDialog( |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value, | 239 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value, |
248 profile_full_name); | 240 profile_full_name); |
249 #endif // defined(OS_ANDROID) | 241 #endif // defined(OS_ANDROID) |
250 } | 242 } |
251 | 243 |
252 void ChromeAutofillClient::OnFirstUserGestureObserved() { | 244 void ChromeAutofillClient::OnFirstUserGestureObserved() { |
253 web_contents()->SendToAllFrames( | 245 web_contents()->SendToAllFrames( |
254 new AutofillMsg_FirstUserGestureObservedInTab(routing_id())); | 246 new AutofillMsg_FirstUserGestureObservedInTab(routing_id())); |
255 } | 247 } |
256 | 248 |
| 249 infobars::InfoBarManager* ChromeAutofillClient::GetInfoBarManager() { |
| 250 return InfoBarService::FromWebContents(web_contents()); |
| 251 } |
| 252 |
257 } // namespace autofill | 253 } // namespace autofill |
OLD | NEW |