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

Side by Side Diff: webkit/glue/webpasswordautocompletelistener_impl.cc

Issue 3071003: AutoFill: Display a right-aligned generic CC icon in the suggestions popup for (Closed)
Patch Set: Rebase. Created 10 years, 4 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
« no previous file with comments | « webkit/glue/webkitclient_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // This file provides the implementaiton of the password manager's autocomplete 5 // This file provides the implementaiton of the password manager's autocomplete
6 // component. 6 // component.
7 7
8 #include "webkit/glue/webpasswordautocompletelistener_impl.h" 8 #include "webkit/glue/webpasswordautocompletelistener_impl.h"
9 9
10 #include <vector> 10 #include <vector>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void WebInputElementDelegate::SetSelectionRange(size_t start, size_t end) { 52 void WebInputElementDelegate::SetSelectionRange(size_t start, size_t end) {
53 element_.setSelectionRange(start, end); 53 element_.setSelectionRange(start, end);
54 } 54 }
55 55
56 void WebInputElementDelegate::RefreshAutofillPopup( 56 void WebInputElementDelegate::RefreshAutofillPopup(
57 const std::vector<string16>& suggestions) { 57 const std::vector<string16>& suggestions) {
58 WebView* webview = element_.document().frame()->view(); 58 WebView* webview = element_.document().frame()->view();
59 if (webview) { 59 if (webview) {
60 std::vector<string16> names; 60 std::vector<string16> names;
61 std::vector<string16> labels; 61 std::vector<string16> labels;
62 std::vector<string16> icons;
62 std::vector<int> unique_ids; 63 std::vector<int> unique_ids;
63 64
64 for (size_t i = 0; i < suggestions.size(); ++i) { 65 for (size_t i = 0; i < suggestions.size(); ++i) {
65 names.push_back(suggestions[i]); 66 names.push_back(suggestions[i]);
66 labels.push_back(string16()); 67 labels.push_back(string16());
68 icons.push_back(string16());
67 unique_ids.push_back(0); 69 unique_ids.push_back(0);
68 } 70 }
69 71
70 webview->applyAutoFillSuggestions(element_, names, labels, unique_ids, -1); 72 webview->applyAutoFillSuggestions(
73 element_, names, labels, icons, unique_ids, -1);
71 } 74 }
72 } 75 }
73 76
74 WebPasswordAutocompleteListenerImpl::WebPasswordAutocompleteListenerImpl( 77 WebPasswordAutocompleteListenerImpl::WebPasswordAutocompleteListenerImpl(
75 WebInputElementDelegate* username_delegate, 78 WebInputElementDelegate* username_delegate,
76 WebInputElementDelegate* password_delegate, 79 WebInputElementDelegate* password_delegate,
77 const PasswordFormFillData& data) 80 const PasswordFormFillData& data)
78 : password_delegate_(password_delegate), 81 : password_delegate_(password_delegate),
79 username_delegate_(username_delegate), 82 username_delegate_(username_delegate),
80 data_(data) { 83 data_(data) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 for (PasswordFormFillData::LoginCollection::iterator it = 191 for (PasswordFormFillData::LoginCollection::iterator it =
189 data_.additional_logins.begin(); 192 data_.additional_logins.begin();
190 it != data_.additional_logins.end(); 193 it != data_.additional_logins.end();
191 ++it) { 194 ++it) {
192 if (StartsWith(it->first, input, false)) 195 if (StartsWith(it->first, input, false))
193 suggestions->push_back(it->first); 196 suggestions->push_back(it->first);
194 } 197 }
195 } 198 }
196 199
197 } // namespace webkit_glue 200 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/webkitclient_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698