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

Side by Side Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 133893004: Allow deleting autofill password suggestions on Shift+Delete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow deleting autofill password suggestions on Shift+Delete Created 6 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/content/renderer/password_autofill_agent.h" 5 #include "components/autofill/content/renderer/password_autofill_agent.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 std::vector<base::string16> suggestions; 605 std::vector<base::string16> suggestions;
606 std::vector<base::string16> realms; 606 std::vector<base::string16> realms;
607 GetSuggestions(fill_data, user_input.value(), &suggestions, &realms); 607 GetSuggestions(fill_data, user_input.value(), &suggestions, &realms);
608 DCHECK_EQ(suggestions.size(), realms.size()); 608 DCHECK_EQ(suggestions.size(), realms.size());
609 609
610 FormData form; 610 FormData form;
611 FormFieldData field; 611 FormFieldData field;
612 FindFormAndFieldForInputElement( 612 FindFormAndFieldForInputElement(
613 user_input, &form, &field, REQUIRE_NONE); 613 user_input, &form, &field, REQUIRE_NONE);
614 614
615 scoped_ptr<PasswordForm> password_form =
616 CreatePasswordForm(user_input.form());
617 DCHECK(password_form.get());
618
615 blink::WebInputElement selected_element = user_input; 619 blink::WebInputElement selected_element = user_input;
616 gfx::Rect bounding_box(selected_element.boundsInViewportSpace()); 620 gfx::Rect bounding_box(selected_element.boundsInViewportSpace());
617 621
618 float scale = web_view_->pageScaleFactor(); 622 float scale = web_view_->pageScaleFactor();
619 gfx::RectF bounding_box_scaled(bounding_box.x() * scale, 623 gfx::RectF bounding_box_scaled(bounding_box.x() * scale,
620 bounding_box.y() * scale, 624 bounding_box.y() * scale,
621 bounding_box.width() * scale, 625 bounding_box.width() * scale,
622 bounding_box.height() * scale); 626 bounding_box.height() * scale);
623 Send(new AutofillHostMsg_ShowPasswordSuggestions(routing_id(), 627 Send(new AutofillHostMsg_ShowPasswordSuggestions(routing_id(),
624 field, 628 field,
629 *password_form.get(),
vabr (Chromium) 2014/01/13 14:46:29 The ".get()" should not be needed.
riadh.chtara 2014/01/13 20:34:10 Done.
vabr (Chromium) 2014/01/14 14:11:02 Again, not done -- ".get()" is still there.
625 bounding_box_scaled, 630 bounding_box_scaled,
626 suggestions, 631 suggestions,
627 realms)); 632 realms));
628 return !suggestions.empty(); 633 return !suggestions.empty();
629 } 634 }
630 635
631 void PasswordAutofillAgent::FillFormOnPasswordRecieved( 636 void PasswordAutofillAgent::FillFormOnPasswordRecieved(
632 const PasswordFormFillData& fill_data, 637 const PasswordFormFillData& fill_data,
633 blink::WebInputElement username_element, 638 blink::WebInputElement username_element,
634 blink::WebInputElement password_element) { 639 blink::WebInputElement password_element) {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 } 829 }
825 830
826 PasswordAutofillAgent::AutofillWebUserGestureHandler:: 831 PasswordAutofillAgent::AutofillWebUserGestureHandler::
827 AutofillWebUserGestureHandler(PasswordAutofillAgent* agent) 832 AutofillWebUserGestureHandler(PasswordAutofillAgent* agent)
828 : agent_(agent) {} 833 : agent_(agent) {}
829 834
830 PasswordAutofillAgent::AutofillWebUserGestureHandler:: 835 PasswordAutofillAgent::AutofillWebUserGestureHandler::
831 ~AutofillWebUserGestureHandler() {} 836 ~AutofillWebUserGestureHandler() {}
832 837
833 } // namespace autofill 838 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698