Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: components/autofill/browser/autofill_external_delegate.cc

Issue 15660018: [autofill] Add support for PSL domain matching for password autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated regexp, sanitized result, escaped form domain and added comments. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/utf_string_conversions.h" 5 #include "base/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
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>& origins,
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, origins, empty, password_ids, GetWeakPtr());
Ilya Sherman 2013/06/06 09:25:35 Hmm. Are the origins really just surfaced as labe
nyquist 2013/06/07 22:51:10 Yes, that is the approved UI. Also changed to |rea
Ilya Sherman 2013/06/07 23:47:56 Hrm, ok. Approved by the Chromium UI leads?
nyquist 2013/06/11 03:36:01 It has been approved for now by UI, but it has not
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698