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