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

Side by Side Diff: chrome/renderer/autofill/password_generation_manager.h

Issue 10540069: Refactor detection of account creation forms and fix two minor issues. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_ 5 #ifndef CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_
6 #define CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_ 6 #define CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 22 matching lines...) Expand all
33 protected: 33 protected:
34 // Returns true if this document is one that we should consider analyzing. 34 // Returns true if this document is one that we should consider analyzing.
35 // Virtual so that it can be overriden during testing. 35 // Virtual so that it can be overriden during testing.
36 virtual bool ShouldAnalyzeDocument(const WebKit::WebDocument& document) const; 36 virtual bool ShouldAnalyzeDocument(const WebKit::WebDocument& document) const;
37 37
38 // RenderViewObserver: 38 // RenderViewObserver:
39 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 39 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
40 40
41 private: 41 private:
42 // RenderViewObserver: 42 // RenderViewObserver:
43 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; 43 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE;
zysxqn 2012/06/08 17:10:39 is it because only until then will we know whether
Garrett Casto 2012/06/08 20:15:09 Yeah, layout hasn't happened by DidFinishDocumentL
44 44
45 // WebTextFieldDecoratorClient: 45 // WebTextFieldDecoratorClient:
46 virtual bool shouldAddDecorationTo( 46 virtual bool shouldAddDecorationTo(
47 const WebKit::WebInputElement& element) OVERRIDE; 47 const WebKit::WebInputElement& element) OVERRIDE;
48 virtual bool visibleByDefault() OVERRIDE; 48 virtual bool visibleByDefault() OVERRIDE;
49 virtual WebKit::WebCString imageNameForNormalState() OVERRIDE; 49 virtual WebKit::WebCString imageNameForNormalState() OVERRIDE;
50 virtual WebKit::WebCString imageNameForDisabledState() OVERRIDE; 50 virtual WebKit::WebCString imageNameForDisabledState() OVERRIDE;
51 virtual WebKit::WebCString imageNameForReadOnlyState() OVERRIDE; 51 virtual WebKit::WebCString imageNameForReadOnlyState() OVERRIDE;
52 virtual void handleClick(WebKit::WebInputElement& element) OVERRIDE; 52 virtual void handleClick(WebKit::WebInputElement& element) OVERRIDE;
53 virtual void willDetach(const WebKit::WebInputElement&) OVERRIDE; 53 virtual void willDetach(const WebKit::WebInputElement& element) OVERRIDE;
54
55 bool IsAccountCreationForm(const WebKit::WebFormElement& form,
56 std::vector<WebKit::WebInputElement>* passwords);
Ilya Sherman 2012/06/08 05:22:18 nit: The method name does not give any indication
Ilya Sherman 2012/06/08 05:22:18 nit: Can this be tucked into an anonymous namespac
Garrett Casto 2012/06/08 20:15:09 Done.
Garrett Casto 2012/06/08 20:15:09 Done.
54 57
55 // Message handlers. 58 // Message handlers.
56 void OnPasswordAccepted(const string16& password); 59 void OnPasswordAccepted(const string16& password);
57 void OnPasswordGenerationEnabled(bool enabled); 60 void OnPasswordGenerationEnabled(bool enabled);
58 61
59 // True if password generation is enabled for the profile associated 62 // True if password generation is enabled for the profile associated
60 // with this renderer. 63 // with this renderer.
61 bool enabled_; 64 bool enabled_;
62 65
63 std::vector<WebKit::WebInputElement> passwords_; 66 std::vector<WebKit::WebInputElement> passwords_;
64 67
65 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager); 68 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager);
66 }; 69 };
67 70
68 } // namespace autofill 71 } // namespace autofill
69 72
70 #endif // CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_ 73 #endif // CHROME_RENDERER_AUTOFILL_PASSWORD_GENERATION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698