| 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 #include "components/autofill/core/browser/autofill_external_delegate.h" | 5 #include "components/autofill/core/browser/autofill_external_delegate.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "components/autofill/core/browser/autocomplete_history_manager.h" | 8 #include "components/autofill/core/browser/autocomplete_history_manager.h" |
| 9 #include "components/autofill/core/browser/autofill_manager.h" | 9 #include "components/autofill/core/browser/autofill_manager.h" |
| 10 #include "components/autofill/core/common/autofill_messages.h" | 10 #include "components/autofill/core/common/autofill_messages.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 values, | 126 values, |
| 127 labels, | 127 labels, |
| 128 icons, | 128 icons, |
| 129 ids, | 129 ids, |
| 130 GetWeakPtr()); | 130 GetWeakPtr()); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 void AutofillExternalDelegate::OnShowPasswordSuggestions( | 134 void AutofillExternalDelegate::OnShowPasswordSuggestions( |
| 135 const std::vector<base::string16>& suggestions, | 135 const std::vector<base::string16>& suggestions, |
| 136 const std::vector<base::string16>& realms, |
| 136 const FormFieldData& field, | 137 const FormFieldData& field, |
| 137 const gfx::RectF& element_bounds) { | 138 const gfx::RectF& element_bounds) { |
| 138 autofill_query_field_ = field; | 139 autofill_query_field_ = field; |
| 139 element_bounds_ = element_bounds; | 140 element_bounds_ = element_bounds; |
| 140 | 141 |
| 141 if (suggestions.empty()) { | 142 if (suggestions.empty()) { |
| 142 autofill_manager_->delegate()->HideAutofillPopup(); | 143 autofill_manager_->delegate()->HideAutofillPopup(); |
| 143 return; | 144 return; |
| 144 } | 145 } |
| 145 | 146 |
| 146 std::vector<base::string16> empty(suggestions.size()); | 147 std::vector<base::string16> empty(suggestions.size()); |
| 147 std::vector<int> password_ids(suggestions.size(), | 148 std::vector<int> password_ids(suggestions.size(), |
| 148 WebAutofillClient::MenuItemIDPasswordEntry); | 149 WebAutofillClient::MenuItemIDPasswordEntry); |
| 149 autofill_manager_->delegate()->ShowAutofillPopup( | 150 autofill_manager_->delegate()->ShowAutofillPopup( |
| 150 element_bounds_, | 151 element_bounds_, |
| 151 autofill_query_field_.text_direction, | 152 autofill_query_field_.text_direction, |
| 152 suggestions, | 153 suggestions, |
| 153 empty, | 154 realms, |
| 154 empty, | 155 empty, |
| 155 password_ids, | 156 password_ids, |
| 156 GetWeakPtr()); | 157 GetWeakPtr()); |
| 157 } | 158 } |
| 158 | 159 |
| 159 void AutofillExternalDelegate::SetCurrentDataListValues( | 160 void AutofillExternalDelegate::SetCurrentDataListValues( |
| 160 const std::vector<base::string16>& data_list_values, | 161 const std::vector<base::string16>& data_list_values, |
| 161 const std::vector<base::string16>& data_list_labels, | 162 const std::vector<base::string16>& data_list_labels, |
| 162 const std::vector<base::string16>& data_list_icons, | 163 const std::vector<base::string16>& data_list_icons, |
| 163 const std::vector<int>& data_list_unique_ids) { | 164 const std::vector<int>& data_list_unique_ids) { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 if (!*content::Details<bool>(details).ptr()) | 383 if (!*content::Details<bool>(details).ptr()) |
| 383 autofill_manager_->delegate()->HideAutofillPopup(); | 384 autofill_manager_->delegate()->HideAutofillPopup(); |
| 384 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { | 385 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { |
| 385 autofill_manager_->delegate()->HideAutofillPopup(); | 386 autofill_manager_->delegate()->HideAutofillPopup(); |
| 386 } else { | 387 } else { |
| 387 NOTREACHED(); | 388 NOTREACHED(); |
| 388 } | 389 } |
| 389 } | 390 } |
| 390 | 391 |
| 391 } // namespace autofill | 392 } // namespace autofill |
| OLD | NEW |