| 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" | 9 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" |
| 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 11 #include "chrome/browser/infobars/infobar_service.h" | 11 #include "chrome/browser/infobars/infobar_service.h" |
| 12 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 12 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 14 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
| 15 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 15 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
| 16 #include "chrome/browser/ui/autofill/credit_card_scanner_controller.h" | 16 #include "chrome/browser/ui/autofill/credit_card_scanner_controller.h" |
| 17 #include "chrome/browser/ui/autofill/instrument_unmask_prompt_view.h" |
| 17 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_finder.h" | 19 #include "chrome/browser/ui/browser_finder.h" |
| 19 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
| 20 #include "chrome/browser/ui/chrome_pages.h" | 21 #include "chrome/browser/ui/chrome_pages.h" |
| 21 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 22 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 22 #include "chrome/browser/webdata/web_data_service_factory.h" | 23 #include "chrome/browser/webdata/web_data_service_factory.h" |
| 23 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
| 24 #include "components/autofill/content/browser/content_autofill_driver.h" | 25 #include "components/autofill/content/browser/content_autofill_driver.h" |
| 25 #include "components/autofill/content/common/autofill_messages.h" | 26 #include "components/autofill/content/common/autofill_messages.h" |
| 26 #include "components/autofill/core/common/autofill_pref_names.h" | 27 #include "components/autofill/core/common/autofill_pref_names.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void ChromeAutofillClient::ShowAutofillSettings() { | 99 void ChromeAutofillClient::ShowAutofillSettings() { |
| 99 #if defined(OS_ANDROID) | 100 #if defined(OS_ANDROID) |
| 100 chrome::android::ChromiumApplication::ShowAutofillSettings(); | 101 chrome::android::ChromiumApplication::ShowAutofillSettings(); |
| 101 #else | 102 #else |
| 102 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); | 103 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); |
| 103 if (browser) | 104 if (browser) |
| 104 chrome::ShowSettingsSubPage(browser, chrome::kAutofillSubPage); | 105 chrome::ShowSettingsSubPage(browser, chrome::kAutofillSubPage); |
| 105 #endif // #if defined(OS_ANDROID) | 106 #endif // #if defined(OS_ANDROID) |
| 106 } | 107 } |
| 107 | 108 |
| 109 void ChromeAutofillClient::ShowUnmaskPrompt() { |
| 110 unmask_prompt_ = InstrumentUnmaskPromptView::CreateAndShow( |
| 111 web_contents_, base::Bind(&ChromeAutofillClient::OnUnmaskResponse, |
| 112 base::Unretained(this))); |
| 113 } |
| 114 |
| 115 void ChromeAutofillClient::OnUnmaskResponse(const base::string16& response) { |
| 116 NOTIMPLEMENTED() << " I should probably do something with this: " << response; |
| 117 unmask_prompt_.reset(); |
| 118 } |
| 119 |
| 108 void ChromeAutofillClient::ConfirmSaveCreditCard( | 120 void ChromeAutofillClient::ConfirmSaveCreditCard( |
| 109 const AutofillMetrics& metric_logger, | 121 const AutofillMetrics& metric_logger, |
| 110 const base::Closure& save_card_callback) { | 122 const base::Closure& save_card_callback) { |
| 111 InfoBarService* infobar_service = | 123 InfoBarService* infobar_service = |
| 112 InfoBarService::FromWebContents(web_contents_); | 124 InfoBarService::FromWebContents(web_contents_); |
| 113 AutofillCCInfoBarDelegate::Create( | 125 AutofillCCInfoBarDelegate::Create( |
| 114 infobar_service, &metric_logger, save_card_callback); | 126 infobar_service, &metric_logger, save_card_callback); |
| 115 } | 127 } |
| 116 | 128 |
| 117 bool ChromeAutofillClient::HasCreditCardScanFeature() { | 129 bool ChromeAutofillClient::HasCreditCardScanFeature() { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 void ChromeAutofillClient::DidFillOrPreviewField( | 228 void ChromeAutofillClient::DidFillOrPreviewField( |
| 217 const base::string16& autofilled_value, | 229 const base::string16& autofilled_value, |
| 218 const base::string16& profile_full_name) { | 230 const base::string16& profile_full_name) { |
| 219 #if defined(OS_ANDROID) | 231 #if defined(OS_ANDROID) |
| 220 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value, | 232 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value, |
| 221 profile_full_name); | 233 profile_full_name); |
| 222 #endif // defined(OS_ANDROID) | 234 #endif // defined(OS_ANDROID) |
| 223 } | 235 } |
| 224 | 236 |
| 225 } // namespace autofill | 237 } // namespace autofill |
| OLD | NEW |