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

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

Issue 2660643002: Use an OOPIF-compatible call chain when finding the top-level frame (Closed)
Patch Set: Created 3 years, 10 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 | « 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 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 blink::WebInputElement password_element; 846 blink::WebInputElement password_element;
847 PasswordInfo* password_info; 847 PasswordInfo* password_info;
848 848
849 if (!FindPasswordInfoForElement(element, &username_element, &password_element, 849 if (!FindPasswordInfoForElement(element, &username_element, &password_element,
850 &password_info)) { 850 &password_info)) {
851 // If we don't have a password stored, but the form is non-secure, warn 851 // If we don't have a password stored, but the form is non-secure, warn
852 // the user about the non-secure form. 852 // the user about the non-secure form.
853 if ((element.isPasswordField() || 853 if ((element.isPasswordField() ||
854 HasAutocompleteAttributeValue(element, "username")) && 854 HasAutocompleteAttributeValue(element, "username")) &&
855 security_state::IsHttpWarningInFormEnabled() && 855 security_state::IsHttpWarningInFormEnabled() &&
856 !content::IsOriginSecure(url::Origin(render_frame() 856 !content::IsOriginSecure(
857 ->GetRenderView() 857 url::Origin(
858 ->GetMainRenderFrame() 858 render_frame()->GetWebFrame()->top()->getSecurityOrigin())
nasko 2017/01/27 21:43:35 Can't we use getSecurityOrigin().isPotentiallyTrus
859 ->GetWebFrame() 859 .GetURL())) {
860 ->getSecurityOrigin())
861 .GetURL())) {
862 autofill_agent_->ShowNotSecureWarning(element); 860 autofill_agent_->ShowNotSecureWarning(element);
863 return true; 861 return true;
864 } 862 }
865 return false; 863 return false;
866 } 864 }
867 865
868 // If autocomplete='off' is set on the form elements, no suggestion dialog 866 // If autocomplete='off' is set on the form elements, no suggestion dialog
869 // should be shown. However, return |true| to indicate that this is a known 867 // should be shown. However, return |true| to indicate that this is a known
870 // password form and that the request to show suggestions has been handled (as 868 // password form and that the request to show suggestions has been handled (as
871 // a no-op). 869 // a no-op).
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 PasswordAutofillAgent::GetPasswordManagerDriver() { 1517 PasswordAutofillAgent::GetPasswordManagerDriver() {
1520 if (!password_manager_driver_) { 1518 if (!password_manager_driver_) {
1521 render_frame()->GetRemoteInterfaces()->GetInterface( 1519 render_frame()->GetRemoteInterfaces()->GetInterface(
1522 mojo::MakeRequest(&password_manager_driver_)); 1520 mojo::MakeRequest(&password_manager_driver_));
1523 } 1521 }
1524 1522
1525 return password_manager_driver_; 1523 return password_manager_driver_;
1526 } 1524 }
1527 1525
1528 } // namespace autofill 1526 } // namespace autofill
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