| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tab_autofill_manager_delegate.h" | 5 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.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" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 const base::Closure& save_card_callback) { | 90 const base::Closure& save_card_callback) { |
| 91 InfoBarService* infobar_service = | 91 InfoBarService* infobar_service = |
| 92 InfoBarService::FromWebContents(web_contents_); | 92 InfoBarService::FromWebContents(web_contents_); |
| 93 AutofillCCInfoBarDelegate::Create( | 93 AutofillCCInfoBarDelegate::Create( |
| 94 infobar_service, &metric_logger, save_card_callback); | 94 infobar_service, &metric_logger, save_card_callback); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void TabAutofillManagerDelegate::ShowRequestAutocompleteDialog( | 97 void TabAutofillManagerDelegate::ShowRequestAutocompleteDialog( |
| 98 const FormData& form, | 98 const FormData& form, |
| 99 const GURL& source_url, | 99 const GURL& source_url, |
| 100 const base::Callback<void(const FormStructure*)>& callback) { | 100 const ResultCallback& callback) { |
| 101 HideRequestAutocompleteDialog(); | 101 HideRequestAutocompleteDialog(); |
| 102 | 102 |
| 103 dialog_controller_ = AutofillDialogController::Create(web_contents_, | 103 dialog_controller_ = AutofillDialogController::Create(web_contents_, |
| 104 form, | 104 form, |
| 105 source_url, | 105 source_url, |
| 106 callback); | 106 callback); |
| 107 if (dialog_controller_) { | 107 if (dialog_controller_) { |
| 108 dialog_controller_->Show(); | 108 dialog_controller_->Show(); |
| 109 } else { | 109 } else { |
| 110 callback.Run(NULL); | 110 callback.Run(AutofillManagerDelegate::AutocompleteResultErrorDisabled, |
| 111 NULL); |
| 111 NOTIMPLEMENTED(); | 112 NOTIMPLEMENTED(); |
| 112 } | 113 } |
| 113 } | 114 } |
| 114 | 115 |
| 115 void TabAutofillManagerDelegate::ShowAutofillPopup( | 116 void TabAutofillManagerDelegate::ShowAutofillPopup( |
| 116 const gfx::RectF& element_bounds, | 117 const gfx::RectF& element_bounds, |
| 117 base::i18n::TextDirection text_direction, | 118 base::i18n::TextDirection text_direction, |
| 118 const std::vector<base::string16>& values, | 119 const std::vector<base::string16>& values, |
| 119 const std::vector<base::string16>& labels, | 120 const std::vector<base::string16>& labels, |
| 120 const std::vector<base::string16>& icons, | 121 const std::vector<base::string16>& icons, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 void TabAutofillManagerDelegate::DidFillOrPreviewField( | 185 void TabAutofillManagerDelegate::DidFillOrPreviewField( |
| 185 const base::string16& autofilled_value, | 186 const base::string16& autofilled_value, |
| 186 const base::string16& profile_full_name) { | 187 const base::string16& profile_full_name) { |
| 187 #if defined(OS_ANDROID) | 188 #if defined(OS_ANDROID) |
| 188 AutofillLoggerAndroid::DidFillOrPreviewField( | 189 AutofillLoggerAndroid::DidFillOrPreviewField( |
| 189 autofilled_value, profile_full_name); | 190 autofilled_value, profile_full_name); |
| 190 #endif // defined(OS_ANDROID) | 191 #endif // defined(OS_ANDROID) |
| 191 } | 192 } |
| 192 | 193 |
| 193 } // namespace autofill | 194 } // namespace autofill |
| OLD | NEW |