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

Side by Side Diff: chrome/renderer/password_autocomplete_manager.cc

Issue 5726007: Autofill suggested dropdown list should be closed with unmatched names (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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
« no previous file with comments | « no previous file | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/renderer/password_autocomplete_manager.h" 5 #include "chrome/renderer/password_autocomplete_manager.h"
6 6
7 #include "app/keyboard_codes.h" 7 #include "app/keyboard_codes.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 for (iter = fill_data.additional_logins.begin(); 406 for (iter = fill_data.additional_logins.begin();
407 iter != fill_data.additional_logins.end(); ++iter) { 407 iter != fill_data.additional_logins.end(); ++iter) {
408 if (StartsWith(iter->first, input, false)) 408 if (StartsWith(iter->first, input, false))
409 suggestions->push_back(iter->first); 409 suggestions->push_back(iter->first);
410 } 410 }
411 } 411 }
412 412
413 bool PasswordAutocompleteManager::ShowSuggestionPopup( 413 bool PasswordAutocompleteManager::ShowSuggestionPopup(
414 const webkit_glue::PasswordFormFillData& fill_data, 414 const webkit_glue::PasswordFormFillData& fill_data,
415 const WebKit::WebInputElement& user_input) { 415 const WebKit::WebInputElement& user_input) {
416 std::vector<string16> suggestions;
417 GetSuggestions(fill_data, user_input.value(), &suggestions);
418 if (suggestions.empty())
419 return false;
420
421 WebKit::WebView* webview = user_input.document().frame()->view(); 416 WebKit::WebView* webview = user_input.document().frame()->view();
422 if (!webview) 417 if (!webview)
423 return false; 418 return false;
424 419
420 std::vector<string16> suggestions;
421 GetSuggestions(fill_data, user_input.value(), &suggestions);
422 if (suggestions.empty()) {
423 webview->hidePopups();
424 return false;
425 }
426
425 std::vector<string16> labels(suggestions.size()); 427 std::vector<string16> labels(suggestions.size());
426 std::vector<string16> icons(suggestions.size()); 428 std::vector<string16> icons(suggestions.size());
427 std::vector<int> ids(suggestions.size(), 0); 429 std::vector<int> ids(suggestions.size(), 0);
428 webview->applyAutoFillSuggestions(user_input, suggestions, labels, icons, ids, 430 webview->applyAutoFillSuggestions(user_input, suggestions, labels, icons, ids,
429 -1); 431 -1);
430 return true; 432 return true;
431 } 433 }
432 434
433 bool PasswordAutocompleteManager::FillUserNameAndPassword( 435 bool PasswordAutocompleteManager::FillUserNameAndPassword(
434 WebKit::WebInputElement* username_element, 436 WebKit::WebInputElement* username_element,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 SetElementAutofilled(username_element, true); 470 SetElementAutofilled(username_element, true);
469 if (IsElementEditable(*password_element)) 471 if (IsElementEditable(*password_element))
470 password_element->setValue(password); 472 password_element->setValue(password);
471 SetElementAutofilled(password_element, true); 473 SetElementAutofilled(password_element, true);
472 return true; 474 return true;
473 } 475 }
474 476
475 int PasswordAutocompleteManager::GetRoutingID() const { 477 int PasswordAutocompleteManager::GetRoutingID() const {
476 return render_view_->routing_id(); 478 return render_view_->routing_id();
477 } 479 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698