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

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

Issue 9600038: Add Password Autofill Manager to New Autofill (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding password popup Created 8 years, 9 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_AUTOFILL_MANAGER_H_ 5 #ifndef CHROME_RENDERER_AUTOFILL_PASSWORD_AUTOFILL_MANAGER_H_
6 #define CHROME_RENDERER_AUTOFILL_PASSWORD_AUTOFILL_MANAGER_H_ 6 #define CHROME_RENDERER_AUTOFILL_PASSWORD_AUTOFILL_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 17 matching lines...) Expand all
28 public PageClickListener { 28 public PageClickListener {
29 public: 29 public:
30 explicit PasswordAutofillManager(content::RenderView* render_view); 30 explicit PasswordAutofillManager(content::RenderView* render_view);
31 virtual ~PasswordAutofillManager(); 31 virtual ~PasswordAutofillManager();
32 32
33 // WebViewClient editor related calls forwarded by the RenderView. 33 // WebViewClient editor related calls forwarded by the RenderView.
34 // If they return true, it indicates the event was consumed and should not 34 // If they return true, it indicates the event was consumed and should not
35 // be used for any other autofill activity. 35 // be used for any other autofill activity.
36 bool TextFieldDidEndEditing(const WebKit::WebInputElement& element); 36 bool TextFieldDidEndEditing(const WebKit::WebInputElement& element);
37 bool TextDidChangeInTextField(const WebKit::WebInputElement& element); 37 bool TextDidChangeInTextField(const WebKit::WebInputElement& element);
38 // If using the new Autofill UI that lives in the browser, it will handle
39 // keypresses before this function. This is not currently an issue but if
40 // the keys handled there or here change, this issue may appear.
Ilya Sherman 2012/03/20 00:58:55 nit: Please move this comment inside the implement
csharp 2012/03/21 14:10:31 Done.
38 bool TextFieldHandlingKeyDown(const WebKit::WebInputElement& element, 41 bool TextFieldHandlingKeyDown(const WebKit::WebInputElement& element,
39 const WebKit::WebKeyboardEvent& event); 42 const WebKit::WebKeyboardEvent& event);
40 43
41 // Fills the password associated with user name |value|. Returns true if the 44 // Fills the password associated with user name |value|. Returns true if the
42 // username and password fields were filled, false otherwise. 45 // username and password fields were filled, false otherwise.
43 bool DidAcceptAutofillSuggestion(const WebKit::WebNode& node, 46 bool DidAcceptAutofillSuggestion(const WebKit::WebNode& node,
44 const WebKit::WebString& value); 47 const WebKit::WebString& value);
45 // A no-op. No filling happens for selection. But this method returns 48 // A no-op. No filling happens for selection. But this method returns
46 // true when |node| is fillable by password Autofill. 49 // true when |node| is fillable by password Autofill.
47 bool DidSelectAutofillSuggestion(const WebKit::WebNode& node); 50 bool DidSelectAutofillSuggestion(const WebKit::WebNode& node);
(...skipping 20 matching lines...) Expand all
68 virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE; 71 virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE;
69 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; 72 virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE;
70 73
71 // PageClickListener: 74 // PageClickListener:
72 virtual bool InputElementClicked(const WebKit::WebInputElement& element, 75 virtual bool InputElementClicked(const WebKit::WebInputElement& element,
73 bool was_focused, 76 bool was_focused,
74 bool is_focused) OVERRIDE; 77 bool is_focused) OVERRIDE;
75 virtual bool InputElementLostFocus() OVERRIDE; 78 virtual bool InputElementLostFocus() OVERRIDE;
76 79
77 // RenderView IPC handlers: 80 // RenderView IPC handlers:
78 void OnFillPasswordForm(const webkit::forms::PasswordFormFillData& form_data); 81 void OnFillPasswordForm(const webkit::forms::PasswordFormFillData& form_data,
82 bool disable_popup);
79 83
80 // Scans the given frame for password forms and sends them up to the browser. 84 // Scans the given frame for password forms and sends them up to the browser.
81 // If |only_visible| is true, only forms visible in the layout are sent. 85 // If |only_visible| is true, only forms visible in the layout are sent.
82 void SendPasswordForms(WebKit::WebFrame* frame, bool only_visible); 86 void SendPasswordForms(WebKit::WebFrame* frame, bool only_visible);
83 87
84 void GetSuggestions(const webkit::forms::PasswordFormFillData& fill_data, 88 void GetSuggestions(const webkit::forms::PasswordFormFillData& fill_data,
85 const string16& input, 89 const string16& input,
86 std::vector<string16>* suggestions); 90 std::vector<string16>* suggestions);
87 91
88 bool ShowSuggestionPopup(const webkit::forms::PasswordFormFillData& fill_data, 92 bool ShowSuggestionPopup(const webkit::forms::PasswordFormFillData& fill_data,
(...skipping 18 matching lines...) Expand all
107 void FrameClosing(const WebKit::WebFrame* frame); 111 void FrameClosing(const WebKit::WebFrame* frame);
108 112
109 // Finds login information for a |node| that was previously filled. 113 // Finds login information for a |node| that was previously filled.
110 bool FindLoginInfo(const WebKit::WebNode& node, 114 bool FindLoginInfo(const WebKit::WebNode& node,
111 WebKit::WebInputElement* found_input, 115 WebKit::WebInputElement* found_input,
112 PasswordInfo* found_password); 116 PasswordInfo* found_password);
113 117
114 // The logins we have filled so far with their associated info. 118 // The logins we have filled so far with their associated info.
115 LoginToPasswordInfoMap login_to_password_info_; 119 LoginToPasswordInfoMap login_to_password_info_;
116 120
121 // Used to disable and hide the popup.
122 bool disable_popup_;
123
117 base::WeakPtrFactory<PasswordAutofillManager> weak_ptr_factory_; 124 base::WeakPtrFactory<PasswordAutofillManager> weak_ptr_factory_;
118 125
119 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillManager); 126 DISALLOW_COPY_AND_ASSIGN(PasswordAutofillManager);
120 }; 127 };
121 128
122 } // namespace autofill 129 } // namespace autofill
123 130
124 #endif // CHROME_RENDERER_AUTOFILL_PASSWORD_AUTOFILL_MANAGER_H_ 131 #endif // CHROME_RENDERER_AUTOFILL_PASSWORD_AUTOFILL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698