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

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

Issue 1455143004: Use the window coordinate for the autofill bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 5 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
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/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 1431
1432 int options = 0; 1432 int options = 0;
1433 if (show_all) 1433 if (show_all)
1434 options |= SHOW_ALL; 1434 options |= SHOW_ALL;
1435 if (show_on_password_field) 1435 if (show_on_password_field)
1436 options |= IS_PASSWORD_FIELD; 1436 options |= IS_PASSWORD_FIELD;
1437 base::string16 username_string( 1437 base::string16 username_string(
1438 username.isNull() ? base::string16() 1438 username.isNull() ? base::string16()
1439 : static_cast<base::string16>(user_input.value())); 1439 : static_cast<base::string16>(user_input.value()));
1440 1440
1441 blink::WebRect bounding_box_in_window = selected_element.boundsInViewport();
1442 render_frame()->GetRenderView()->convertViewportToWindow(
1443 &bounding_box_in_window);
1444
1441 Send(new AutofillHostMsg_ShowPasswordSuggestions( 1445 Send(new AutofillHostMsg_ShowPasswordSuggestions(
1442 routing_id(), key_it->second, field.text_direction, username_string, 1446 routing_id(), key_it->second, field.text_direction, username_string,
1443 options, gfx::RectF(selected_element.boundsInViewport()))); 1447 options, gfx::RectF(bounding_box_in_window)));
1444 username_query_prefix_ = username_string; 1448 username_query_prefix_ = username_string;
1445 return CanShowSuggestion(fill_data, username_string, show_all); 1449 return CanShowSuggestion(fill_data, username_string, show_all);
1446 } 1450 }
1447 1451
1448 void PasswordAutofillAgent::FrameClosing() { 1452 void PasswordAutofillAgent::FrameClosing() {
1449 for (auto const& iter : web_input_to_password_info_) { 1453 for (auto const& iter : web_input_to_password_info_) {
1450 web_element_to_password_info_key_.erase(iter.first); 1454 web_element_to_password_info_key_.erase(iter.first);
1451 password_to_username_.erase(iter.second.password_field); 1455 password_to_username_.erase(iter.second.password_field);
1452 } 1456 }
1453 web_input_to_password_info_.clear(); 1457 web_input_to_password_info_.clear();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 } 1502 }
1499 1503
1500 bool PasswordAutofillAgent::ProvisionallySavedPasswordIsValid() { 1504 bool PasswordAutofillAgent::ProvisionallySavedPasswordIsValid() {
1501 return provisionally_saved_form_ && 1505 return provisionally_saved_form_ &&
1502 !provisionally_saved_form_->username_value.empty() && 1506 !provisionally_saved_form_->username_value.empty() &&
1503 !(provisionally_saved_form_->password_value.empty() && 1507 !(provisionally_saved_form_->password_value.empty() &&
1504 provisionally_saved_form_->new_password_value.empty()); 1508 provisionally_saved_form_->new_password_value.empty());
1505 } 1509 }
1506 1510
1507 } // namespace autofill 1511 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698