OLD | NEW |
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_AUTOFILL_AGENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // to RenderFrameObserver. Should eventually be removed. | 59 // to RenderFrameObserver. Should eventually be removed. |
60 // http://crbug.com/433486 | 60 // http://crbug.com/433486 |
61 class LegacyAutofillAgent : public content::RenderViewObserver { | 61 class LegacyAutofillAgent : public content::RenderViewObserver { |
62 public: | 62 public: |
63 LegacyAutofillAgent(content::RenderView* render_view, AutofillAgent* agent); | 63 LegacyAutofillAgent(content::RenderView* render_view, AutofillAgent* agent); |
64 ~LegacyAutofillAgent() override; | 64 ~LegacyAutofillAgent() override; |
65 | 65 |
66 private: | 66 private: |
67 // content::RenderViewObserver: | 67 // content::RenderViewObserver: |
68 void OnDestruct() override; | 68 void OnDestruct() override; |
69 void FrameDetached(blink::WebFrame* frame) override; | |
70 void FocusedNodeChanged(const blink::WebNode& node) override; | 69 void FocusedNodeChanged(const blink::WebNode& node) override; |
71 void Resized() override; | 70 void Resized() override; |
72 void FrameWillClose(blink::WebFrame* frame) override; | |
73 | 71 |
74 AutofillAgent* agent_; | 72 AutofillAgent* agent_; |
75 | 73 |
76 DISALLOW_COPY_AND_ASSIGN(LegacyAutofillAgent); | 74 DISALLOW_COPY_AND_ASSIGN(LegacyAutofillAgent); |
77 }; | 75 }; |
78 friend class LegacyAutofillAgent; | 76 friend class LegacyAutofillAgent; |
79 | 77 |
80 // Flags passed to ShowSuggestions. | 78 // Flags passed to ShowSuggestions. |
81 struct ShowSuggestionsOptions { | 79 struct ShowSuggestionsOptions { |
82 // All fields are default initialized to false. | 80 // All fields are default initialized to false. |
(...skipping 29 matching lines...) Expand all Loading... |
112 | 110 |
113 // content::RenderFrameObserver: | 111 // content::RenderFrameObserver: |
114 bool OnMessageReceived(const IPC::Message& message) override; | 112 bool OnMessageReceived(const IPC::Message& message) override; |
115 void DidCommitProvisionalLoad(bool is_new_navigation) override; | 113 void DidCommitProvisionalLoad(bool is_new_navigation) override; |
116 void DidFinishDocumentLoad() override; | 114 void DidFinishDocumentLoad() override; |
117 void WillSubmitForm(const blink::WebFormElement& form) override; | 115 void WillSubmitForm(const blink::WebFormElement& form) override; |
118 void DidChangeScrollOffset() override; | 116 void DidChangeScrollOffset() override; |
119 | 117 |
120 // Pass-throughs from LegacyAutofillAgent. These correlate with | 118 // Pass-throughs from LegacyAutofillAgent. These correlate with |
121 // RenderViewObserver methods. | 119 // RenderViewObserver methods. |
122 void FrameDetached(blink::WebFrame* frame); | |
123 void FocusedNodeChanged(const blink::WebNode& node); | 120 void FocusedNodeChanged(const blink::WebNode& node); |
124 void Resized(); | 121 void Resized(); |
125 void LegacyFrameWillClose(blink::WebFrame* frame); | |
126 | 122 |
127 // PageClickListener: | 123 // PageClickListener: |
128 void FormControlElementClicked(const blink::WebFormControlElement& element, | 124 void FormControlElementClicked(const blink::WebFormControlElement& element, |
129 bool was_focused) override; | 125 bool was_focused) override; |
130 | 126 |
131 // blink::WebAutofillClient: | 127 // blink::WebAutofillClient: |
132 virtual void textFieldDidEndEditing( | 128 virtual void textFieldDidEndEditing( |
133 const blink::WebInputElement& element); | 129 const blink::WebInputElement& element); |
134 virtual void textFieldDidChange( | 130 virtual void textFieldDidChange( |
135 const blink::WebFormControlElement& element); | 131 const blink::WebFormControlElement& element); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 void PreviewFieldWithValue(const base::string16& value, | 206 void PreviewFieldWithValue(const base::string16& value, |
211 blink::WebInputElement* node); | 207 blink::WebInputElement* node); |
212 | 208 |
213 // Notifies browser of new fillable forms in |render_frame|. | 209 // Notifies browser of new fillable forms in |render_frame|. |
214 void ProcessForms(); | 210 void ProcessForms(); |
215 | 211 |
216 // Hides any currently showing Autofill popup. | 212 // Hides any currently showing Autofill popup. |
217 void HidePopup(); | 213 void HidePopup(); |
218 | 214 |
219 // Formerly cached forms for all frames, now only caches forms for the current | 215 // Formerly cached forms for all frames, now only caches forms for the current |
220 // frame. TODO(estade): simplify |FormCache| to only work with a single frame. | 216 // frame. |
221 FormCache form_cache_; | 217 FormCache form_cache_; |
222 | 218 |
223 PasswordAutofillAgent* password_autofill_agent_; // Weak reference. | 219 PasswordAutofillAgent* password_autofill_agent_; // Weak reference. |
224 PasswordGenerationAgent* password_generation_agent_; // Weak reference. | 220 PasswordGenerationAgent* password_generation_agent_; // Weak reference. |
225 | 221 |
226 // Passes through RenderViewObserver methods to |this|. | 222 // Passes through RenderViewObserver methods to |this|. |
227 LegacyAutofillAgent legacy_; | 223 LegacyAutofillAgent legacy_; |
228 | 224 |
229 // Tracks clicks on the RenderViewHost, informs |this|. | 225 // Tracks clicks on the RenderViewHost, informs |this|. |
230 PageClickTracker page_click_tracker_; | 226 PageClickTracker page_click_tracker_; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 bool is_popup_possibly_visible_; | 259 bool is_popup_possibly_visible_; |
264 | 260 |
265 base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_; | 261 base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_; |
266 | 262 |
267 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); | 263 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); |
268 }; | 264 }; |
269 | 265 |
270 } // namespace autofill | 266 } // namespace autofill |
271 | 267 |
272 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ | 268 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ |
OLD | NEW |