| 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 CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ | 5 #ifndef CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ |
| 6 #define CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ | 6 #define CHROME_RENDERER_AUTOFILL_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/timer.h" | 14 #include "base/timer.h" |
| 15 #include "chrome/renderer/autofill/form_cache.h" | 15 #include "chrome/renderer/autofill/form_cache.h" |
| 16 #include "chrome/renderer/page_click_listener.h" | 16 #include "chrome/renderer/page_click_listener.h" |
| 17 #include "content/public/renderer/render_view_observer.h" | 17 #include "content/public/renderer/render_view_observer.h" |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
| 21 | 21 |
| 22 struct FormFieldData; | 22 struct FormFieldData; |
| 23 | 23 |
| 24 namespace WebKit { | 24 namespace WebKit { |
| 25 class WebNode; | 25 class WebNode; |
| 26 class WebView; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace autofill { | 29 namespace autofill { |
| 29 | 30 |
| 30 struct WebElementDescriptor; | 31 struct WebElementDescriptor; |
| 31 class PasswordAutofillManager; | 32 class PasswordAutofillManager; |
| 32 | 33 |
| 33 // AutofillAgent deals with Autofill related communications between WebKit and | 34 // AutofillAgent deals with Autofill related communications between WebKit and |
| 34 // the browser. There is one AutofillAgent per RenderView. | 35 // the browser. There is one AutofillAgent per RenderView. |
| 35 // This code was originally part of RenderView. | 36 // This code was originally part of RenderView. |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // All the form elements seen in the top frame. | 216 // All the form elements seen in the top frame. |
| 216 std::vector<WebKit::WebFormElement> form_elements_; | 217 std::vector<WebKit::WebFormElement> form_elements_; |
| 217 | 218 |
| 218 // The action to take when receiving Autofill data from the AutofillManager. | 219 // The action to take when receiving Autofill data from the AutofillManager. |
| 219 AutofillAction autofill_action_; | 220 AutofillAction autofill_action_; |
| 220 | 221 |
| 221 // Pointer to the current topmost frame. Used in autocheckout flows so | 222 // Pointer to the current topmost frame. Used in autocheckout flows so |
| 222 // elements can be clicked. | 223 // elements can be clicked. |
| 223 WebKit::WebFrame* topmost_frame_; | 224 WebKit::WebFrame* topmost_frame_; |
| 224 | 225 |
| 226 // Pointer to the WebView. Used to access page scale factor. |
| 227 WebKit::WebView* web_view_; |
| 228 |
| 225 // Should we display a warning if autofill is disabled? | 229 // Should we display a warning if autofill is disabled? |
| 226 bool display_warning_if_disabled_; | 230 bool display_warning_if_disabled_; |
| 227 | 231 |
| 228 // Was the query node autofilled prior to previewing the form? | 232 // Was the query node autofilled prior to previewing the form? |
| 229 bool was_query_node_autofilled_; | 233 bool was_query_node_autofilled_; |
| 230 | 234 |
| 231 // Have we already shown Autofill suggestions for the field the user is | 235 // Have we already shown Autofill suggestions for the field the user is |
| 232 // currently editing? Used to keep track of state for metrics logging. | 236 // currently editing? Used to keep track of state for metrics logging. |
| 233 bool has_shown_autofill_popup_for_current_edit_; | 237 bool has_shown_autofill_popup_for_current_edit_; |
| 234 | 238 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 251 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, WaitUsername); | 255 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, WaitUsername); |
| 252 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionAccept); | 256 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionAccept); |
| 253 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionSelect); | 257 FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionSelect); |
| 254 | 258 |
| 255 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); | 259 DISALLOW_COPY_AND_ASSIGN(AutofillAgent); |
| 256 }; | 260 }; |
| 257 | 261 |
| 258 } // namespace autofill | 262 } // namespace autofill |
| 259 | 263 |
| 260 #endif // CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ | 264 #endif // CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ |
| OLD | NEW |