OLD | NEW |
---|---|
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 COMPONENTS_AUTOFILL_RENDERER_AUTOFILL_AGENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_RENDERER_AUTOFILL_AGENT_H_ |
6 #define COMPONENTS_AUTOFILL_RENDERER_AUTOFILL_AGENT_H_ | 6 #define COMPONENTS_AUTOFILL_RENDERER_AUTOFILL_AGENT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "base/timer.h" | 15 #include "base/timer.h" |
16 #include "components/autofill/common/forms_seen_param.h" | |
16 #include "components/autofill/renderer/form_cache.h" | 17 #include "components/autofill/renderer/form_cache.h" |
17 #include "components/autofill/renderer/page_click_listener.h" | 18 #include "components/autofill/renderer/page_click_listener.h" |
18 #include "content/public/renderer/render_view_observer.h" | 19 #include "content/public/renderer/render_view_observer.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
22 | 23 |
23 struct FormFieldData; | 24 struct FormFieldData; |
24 | 25 |
25 namespace WebKit { | 26 namespace WebKit { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 | 200 |
200 // Set |node| to display the given |value|. | 201 // Set |node| to display the given |value|. |
201 void SetNodeText(const string16& value, WebKit::WebInputElement* node); | 202 void SetNodeText(const string16& value, WebKit::WebInputElement* node); |
202 | 203 |
203 // Hides any currently showing Autofill UI in the renderer or browser. | 204 // Hides any currently showing Autofill UI in the renderer or browser. |
204 void HideAutofillUi(); | 205 void HideAutofillUi(); |
205 | 206 |
206 // Hides any currently showing Autofill UI in the browser only. | 207 // Hides any currently showing Autofill UI in the browser only. |
207 void HideHostAutofillUi(); | 208 void HideHostAutofillUi(); |
208 | 209 |
210 void SendDynamicFormsSeen(); | |
211 | |
209 FormCache form_cache_; | 212 FormCache form_cache_; |
210 | 213 |
211 PasswordAutofillManager* password_autofill_manager_; // WEAK reference. | 214 PasswordAutofillManager* password_autofill_manager_; // WEAK reference. |
212 | 215 |
213 // The ID of the last request sent for form field Autofill. Used to ignore | 216 // The ID of the last request sent for form field Autofill. Used to ignore |
214 // out of date responses. | 217 // out of date responses. |
215 int autofill_query_id_; | 218 int autofill_query_id_; |
216 | 219 |
217 // The element corresponding to the last request sent for form field Autofill. | 220 // The element corresponding to the last request sent for form field Autofill. |
218 WebKit::WebInputElement element_; | 221 WebKit::WebInputElement element_; |
(...skipping 30 matching lines...) Expand all Loading... | |
249 // Watchdog timer for clicking in Autocheckout flows. | 252 // Watchdog timer for clicking in Autocheckout flows. |
250 base::OneShotTimer<AutofillAgent> click_timer_; | 253 base::OneShotTimer<AutofillAgent> click_timer_; |
251 | 254 |
252 // Used to signal that we need to watch for loading failures in an | 255 // Used to signal that we need to watch for loading failures in an |
253 // Autocheckout flow. | 256 // Autocheckout flow. |
254 bool autocheckout_click_in_progress_; | 257 bool autocheckout_click_in_progress_; |
255 | 258 |
256 // Whether or not |topmost_frame_| is whitelisted for Autocheckout. | 259 // Whether or not |topmost_frame_| is whitelisted for Autocheckout. |
257 bool is_whitelisted_for_autocheckout_; | 260 bool is_whitelisted_for_autocheckout_; |
258 | 261 |
262 // Whether or not new forms/fields have been dynamically added | |
263 // post-document load. | |
264 bool forms_have_changed_since_load_; | |
Ilya Sherman
2013/04/06 00:29:39
You should make sure to initialize this in the ini
Ilya Sherman
2013/04/06 00:29:39
nit: This variable is actually tracking whether or
Dane Wallinga
2013/04/08 22:55:50
Done.
Dane Wallinga
2013/04/08 22:55:50
Done.
| |
265 | |
259 // Whether or not to ignore text changes. Useful for when we're committing | 266 // Whether or not to ignore text changes. Useful for when we're committing |
260 // a composition when we are defocusing the WebView and we don't want to | 267 // a composition when we are defocusing the WebView and we don't want to |
261 // trigger an autofill popup to show. | 268 // trigger an autofill popup to show. |
262 bool ignore_text_changes_; | 269 bool ignore_text_changes_; |
263 | 270 |
264 // Timestamp of first time forms are seen. | 271 // Timestamp of first time forms are seen. |
265 base::TimeTicks forms_seen_timestamp_; | 272 base::TimeTicks forms_seen_timestamp_; |
266 | 273 |
267 base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_; | 274 base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_; |
268 | 275 |
276 virtual void didAssociateFormControls( | |
277 const WebKit::WebVector<WebKit::WebNode>& nodes) OVERRIDE; | |
Ilya Sherman
2013/04/06 00:29:39
nit: This should be grouped with whatever set of m
Dane Wallinga
2013/04/08 22:55:50
Done.
| |
278 | |
269 friend class PasswordAutofillManagerTest; | 279 friend class PasswordAutofillManagerTest; |
270 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, FillFormElement); | 280 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, FillFormElement); |
271 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, SendForms); | 281 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, SendForms); |
282 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, SendDynamicForms); | |
272 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, ShowAutofillWarning); | 283 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, ShowAutofillWarning); |
273 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, WaitUsername); | 284 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, WaitUsername); |
274 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionAccept); | 285 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionAccept); |
275 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionSelect); | 286 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionSelect); |
276 | 287 |
277 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); | 288 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); |
278 }; | 289 }; |
279 | 290 |
280 } // namespace autofill | 291 } // namespace autofill |
281 | 292 |
282 #endif // COMPONENTS_AUTOFILL_RENDERER_AUTOFILL_AGENT_H_ | 293 #endif // COMPONENTS_AUTOFILL_RENDERER_AUTOFILL_AGENT_H_ |
OLD | NEW |