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

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

Issue 151503006: Re-land r248110 with ASAN error fixed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Punctuation Created 6 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
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_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 14 matching lines...) Expand all
25 class WebNode; 25 class WebNode;
26 class WebView; 26 class WebView;
27 } 27 }
28 28
29 namespace autofill { 29 namespace autofill {
30 30
31 struct FormData; 31 struct FormData;
32 struct FormFieldData; 32 struct FormFieldData;
33 struct WebElementDescriptor; 33 struct WebElementDescriptor;
34 class PasswordAutofillAgent; 34 class PasswordAutofillAgent;
35 class PasswordGenerationAgent;
35 36
36 // AutofillAgent deals with Autofill related communications between WebKit and 37 // AutofillAgent deals with Autofill related communications between WebKit and
37 // the browser. There is one AutofillAgent per RenderView. 38 // the browser. There is one AutofillAgent per RenderView.
38 // This code was originally part of RenderView. 39 // This code was originally part of RenderView.
39 // Note that Autofill encompasses: 40 // Note that Autofill encompasses:
40 // - single text field suggestions, that we usually refer to as Autocomplete, 41 // - single text field suggestions, that we usually refer to as Autocomplete,
41 // - password form fill, refered to as Password Autofill, and 42 // - password form fill, refered to as Password Autofill, and
42 // - entire form fill based on one field entry, referred to as Form Autofill. 43 // - entire form fill based on one field entry, referred to as Form Autofill.
43 44
44 class AutofillAgent : public content::RenderViewObserver, 45 class AutofillAgent : public content::RenderViewObserver,
45 public PageClickListener, 46 public PageClickListener,
46 public blink::WebAutofillClient { 47 public blink::WebAutofillClient {
47 public: 48 public:
48 // PasswordAutofillAgent is guaranteed to outlive AutofillAgent. 49 // PasswordAutofillAgent is guaranteed to outlive AutofillAgent.
50 // PasswordGenerationAgent may be NULL. If it is not, then it is also
51 // guaranteed to outlive AutofillAgent.
49 AutofillAgent(content::RenderView* render_view, 52 AutofillAgent(content::RenderView* render_view,
50 PasswordAutofillAgent* password_autofill_manager); 53 PasswordAutofillAgent* password_autofill_manager,
54 PasswordGenerationAgent* password_generation_agent);
51 virtual ~AutofillAgent(); 55 virtual ~AutofillAgent();
52 56
53 private: 57 private:
54 enum AutofillAction { 58 enum AutofillAction {
55 AUTOFILL_NONE, // No state set. 59 AUTOFILL_NONE, // No state set.
56 AUTOFILL_FILL, // Fill the Autofill form data. 60 AUTOFILL_FILL, // Fill the Autofill form data.
57 AUTOFILL_PREVIEW, // Preview the Autofill form data. 61 AUTOFILL_PREVIEW, // Preview the Autofill form data.
58 }; 62 };
59 63
60 // RenderView::Observer: 64 // RenderView::Observer:
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 FormFieldData* field) WARN_UNUSED_RESULT; 171 FormFieldData* field) WARN_UNUSED_RESULT;
168 172
169 // Set |node| to display the given |value|. 173 // Set |node| to display the given |value|.
170 void SetNodeText(const base::string16& value, blink::WebInputElement* node); 174 void SetNodeText(const base::string16& value, blink::WebInputElement* node);
171 175
172 // Hides any currently showing Autofill UI. 176 // Hides any currently showing Autofill UI.
173 void HideAutofillUI(); 177 void HideAutofillUI();
174 178
175 FormCache form_cache_; 179 FormCache form_cache_;
176 180
177 PasswordAutofillAgent* password_autofill_agent_; // WEAK reference. 181 PasswordAutofillAgent* password_autofill_agent_; // Weak reference.
182 PasswordGenerationAgent* password_generation_agent_; // Weak reference.
178 183
179 // The ID of the last request sent for form field Autofill. Used to ignore 184 // The ID of the last request sent for form field Autofill. Used to ignore
180 // out of date responses. 185 // out of date responses.
181 int autofill_query_id_; 186 int autofill_query_id_;
182 187
183 // The element corresponding to the last request sent for form field Autofill. 188 // The element corresponding to the last request sent for form field Autofill.
184 blink::WebInputElement element_; 189 blink::WebInputElement element_;
185 190
186 // The form element currently requesting an interactive autocomplete. 191 // The form element currently requesting an interactive autocomplete.
187 blink::WebFormElement in_flight_request_form_; 192 blink::WebFormElement in_flight_request_form_;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 FRIEND_TEST_ALL_PREFIXES( 238 FRIEND_TEST_ALL_PREFIXES(
234 PasswordAutofillAgentTest, 239 PasswordAutofillAgentTest,
235 PasswordAutofillTriggersOnChangeEventsWaitForUsername); 240 PasswordAutofillTriggersOnChangeEventsWaitForUsername);
236 241
237 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); 242 DISALLOW_COPY_AND_ASSIGN(AutofillAgent);
238 }; 243 };
239 244
240 } // namespace autofill 245 } // namespace autofill
241 246
242 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_ 247 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_AUTOFILL_AGENT_H_
OLDNEW
« no previous file with comments | « components/autofill/content/common/autofill_messages.h ('k') | components/autofill/content/renderer/autofill_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698