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

Side by Side Diff: components/autofill/content/renderer/password_form_conversion_utils.h

Issue 1039833002: [Password Manager] Unify action and origin detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test Created 5 years, 8 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 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H_ 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H_
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H_ 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "url/gurl.h"
11 12
12 namespace blink { 13 namespace blink {
14 class WebDocument;
13 class WebFormElement; 15 class WebFormElement;
14 class WebInputElement; 16 class WebInputElement;
15 class WebString; 17 class WebString;
16 } 18 }
17 19
18 namespace autofill { 20 namespace autofill {
19 21
20 struct PasswordForm; 22 struct PasswordForm;
21 23
24 // Helper functions to assist in getting the canonical form of the action and
25 // origin. The action will proplerly take into account <BASE>, and both will
26 // strip unnecessary data (e.g. query params and HTTP credentials).
27 GURL GetCanonicalActionForForm(const blink::WebFormElement& form);
28 GURL GetCanonicalOriginForDocument(const blink::WebDocument& document);
29
22 // Create a PasswordForm from DOM form. Webkit doesn't allow storing 30 // Create a PasswordForm from DOM form. Webkit doesn't allow storing
23 // custom metadata to DOM nodes, so we have to do this every time an event 31 // custom metadata to DOM nodes, so we have to do this every time an event
24 // happens with a given form and compare against previously Create'd forms 32 // happens with a given form and compare against previously Create'd forms
25 // to identify..which sucks. 33 // to identify..which sucks.
26 // If an element of |form| has an entry in |nonscript_modified_values|, the 34 // If an element of |form| has an entry in |nonscript_modified_values|, the
27 // associated string is used instead of the element's value to create 35 // associated string is used instead of the element's value to create
28 // the PasswordForm. 36 // the PasswordForm.
29 scoped_ptr<PasswordForm> CreatePasswordForm( 37 scoped_ptr<PasswordForm> CreatePasswordForm(
30 const blink::WebFormElement& form, 38 const blink::WebFormElement& form,
31 const std::map<const blink::WebInputElement, blink::WebString>* 39 const std::map<const blink::WebInputElement, blink::WebString>*
32 nonscript_modified_values); 40 nonscript_modified_values);
33 41
34 } // namespace autofill 42 } // namespace autofill
35 43
36 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H __ 44 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_FORM_CONVERSION_UTILS_H __
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698