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

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

Issue 5337011: Autofill API cleanup of deprecated methods (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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 const WebKit::WebInputElement& user_input) { 415 const WebKit::WebInputElement& user_input) {
416 std::vector<string16> suggestions; 416 std::vector<string16> suggestions;
417 GetSuggestions(fill_data, user_input.value(), &suggestions); 417 GetSuggestions(fill_data, user_input.value(), &suggestions);
418 if (suggestions.empty()) 418 if (suggestions.empty())
419 return false; 419 return false;
420 420
421 WebKit::WebView* webview = user_input.document().frame()->view(); 421 WebKit::WebView* webview = user_input.document().frame()->view();
422 if (!webview) 422 if (!webview)
423 return false; 423 return false;
424 424
425 webview->applyAutocompleteSuggestions(user_input, suggestions, -1); 425 std::vector<string16> labels(suggestions.size());
426 std::vector<string16> icons(suggestions.size());
427 std::vector<int> ids(suggestions.size(), 0);
428 webview->applyAutoFillSuggestions(user_input, suggestions, labels, icons, ids,
429 -1);
426 return true; 430 return true;
427 } 431 }
428 432
429 bool PasswordAutocompleteManager::FillUserNameAndPassword( 433 bool PasswordAutocompleteManager::FillUserNameAndPassword(
430 WebKit::WebInputElement* username_element, 434 WebKit::WebInputElement* username_element,
431 WebKit::WebInputElement* password_element, 435 WebKit::WebInputElement* password_element,
432 const webkit_glue::PasswordFormFillData& fill_data, 436 const webkit_glue::PasswordFormFillData& fill_data,
433 bool exact_username_match) { 437 bool exact_username_match) {
434 string16 current_username = username_element->value(); 438 string16 current_username = username_element->value();
435 // username and password will contain the match found if any. 439 // username and password will contain the match found if any.
(...skipping 28 matching lines...) Expand all
464 SetElementAutofilled(username_element, true); 468 SetElementAutofilled(username_element, true);
465 if (IsElementEditable(*password_element)) 469 if (IsElementEditable(*password_element))
466 password_element->setValue(password); 470 password_element->setValue(password);
467 SetElementAutofilled(password_element, true); 471 SetElementAutofilled(password_element, true);
468 return true; 472 return true;
469 } 473 }
470 474
471 int PasswordAutocompleteManager::GetRoutingID() const { 475 int PasswordAutocompleteManager::GetRoutingID() const {
472 return render_view_->routing_id(); 476 return render_view_->routing_id();
473 } 477 }
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