| 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" | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 53 | 53 | 
| 54   // RenderView::Observer: | 54   // RenderView::Observer: | 
| 55   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 55   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 
| 56   virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; | 56   virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; | 
| 57   virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE; | 57   virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE; | 
| 58   virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; | 58   virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; | 
| 59   virtual void WillSubmitForm(WebKit::WebFrame* frame, | 59   virtual void WillSubmitForm(WebKit::WebFrame* frame, | 
| 60                               const WebKit::WebFormElement& form) OVERRIDE; | 60                               const WebKit::WebFormElement& form) OVERRIDE; | 
| 61   virtual void ZoomLevelChanged() OVERRIDE; | 61   virtual void ZoomLevelChanged() OVERRIDE; | 
| 62   virtual void DidChangeScrollOffset(WebKit::WebFrame* frame) OVERRIDE; | 62   virtual void DidChangeScrollOffset(WebKit::WebFrame* frame) OVERRIDE; | 
|  | 63   virtual void RequestAutocomplete(WebKit::WebFrame* frame, | 
|  | 64                                    const WebKit::WebFormElement& form) OVERRIDE; | 
| 63 | 65 | 
| 64   // PageClickListener: | 66   // PageClickListener: | 
| 65   virtual bool InputElementClicked(const WebKit::WebInputElement& element, | 67   virtual bool InputElementClicked(const WebKit::WebInputElement& element, | 
| 66                                    bool was_focused, | 68                                    bool was_focused, | 
| 67                                    bool is_focused) OVERRIDE; | 69                                    bool is_focused) OVERRIDE; | 
| 68   virtual bool InputElementLostFocus() OVERRIDE; | 70   virtual bool InputElementLostFocus() OVERRIDE; | 
| 69 | 71 | 
| 70   // WebKit::WebAutofillClient: | 72   // WebKit::WebAutofillClient: | 
| 71   virtual void didAcceptAutofillSuggestion(const WebKit::WebNode& node, | 73   virtual void didAcceptAutofillSuggestion(const WebKit::WebNode& node, | 
| 72                                            const WebKit::WebString& value, | 74                                            const WebKit::WebString& value, | 
| (...skipping 28 matching lines...) Expand all  Loading... | 
| 101   // For external Autofill selection. | 103   // For external Autofill selection. | 
| 102   void OnSelectAutofillSuggestionAtIndex(int listIndex); | 104   void OnSelectAutofillSuggestionAtIndex(int listIndex); | 
| 103   void OnSetAutofillActionFill(); | 105   void OnSetAutofillActionFill(); | 
| 104   void OnClearForm(); | 106   void OnClearForm(); | 
| 105   void OnSetAutofillActionPreview(); | 107   void OnSetAutofillActionPreview(); | 
| 106   void OnClearPreviewedForm(); | 108   void OnClearPreviewedForm(); | 
| 107   void OnSetNodeText(const string16& value); | 109   void OnSetNodeText(const string16& value); | 
| 108   void OnAcceptDataListSuggestion(const string16& value); | 110   void OnAcceptDataListSuggestion(const string16& value); | 
| 109   void OnAcceptPasswordAutofillSuggestion(const string16& value); | 111   void OnAcceptPasswordAutofillSuggestion(const string16& value); | 
| 110 | 112 | 
|  | 113   // For interactive autocomplete. | 
|  | 114   void OnRequestAutocompleteFinished(int query_id, bool success); | 
|  | 115 | 
| 111   // Called in a posted task by textFieldDidChange() to work-around a WebKit bug | 116   // Called in a posted task by textFieldDidChange() to work-around a WebKit bug | 
| 112   // http://bugs.webkit.org/show_bug.cgi?id=16976 | 117   // http://bugs.webkit.org/show_bug.cgi?id=16976 | 
| 113   void TextFieldDidChangeImpl(const WebKit::WebInputElement& element); | 118   void TextFieldDidChangeImpl(const WebKit::WebInputElement& element); | 
| 114 | 119 | 
| 115   // Shows the autofill suggestions for |element|. | 120   // Shows the autofill suggestions for |element|. | 
| 116   // This call is asynchronous and may or may not lead to the showing of a | 121   // This call is asynchronous and may or may not lead to the showing of a | 
| 117   // suggestion popup (no popup is shown if there are no available suggestions). | 122   // suggestion popup (no popup is shown if there are no available suggestions). | 
| 118   // |autofill_on_empty_values| specifies whether suggestions should be shown | 123   // |autofill_on_empty_values| specifies whether suggestions should be shown | 
| 119   // when |element| contains no text. | 124   // when |element| contains no text. | 
| 120   // |requires_caret_at_end| specifies whether suggestions should be shown when | 125   // |requires_caret_at_end| specifies whether suggestions should be shown when | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 156   // Fills |form| and |field| with the FormData and FormField corresponding to | 161   // Fills |form| and |field| with the FormData and FormField corresponding to | 
| 157   // |node|. Returns true if the data was found; and false otherwise. | 162   // |node|. Returns true if the data was found; and false otherwise. | 
| 158   bool FindFormAndFieldForNode( | 163   bool FindFormAndFieldForNode( | 
| 159       const WebKit::WebNode& node, | 164       const WebKit::WebNode& node, | 
| 160       FormData* form, | 165       FormData* form, | 
| 161       FormFieldData* field) WARN_UNUSED_RESULT; | 166       FormFieldData* field) WARN_UNUSED_RESULT; | 
| 162 | 167 | 
| 163   // Set |node| to display the given |value|. | 168   // Set |node| to display the given |value|. | 
| 164   void SetNodeText(const string16& value, WebKit::WebInputElement* node); | 169   void SetNodeText(const string16& value, WebKit::WebInputElement* node); | 
| 165 | 170 | 
|  | 171   // Hides any currently showing autofill popups. | 
|  | 172   void HidePopups(); | 
|  | 173 | 
| 166   FormCache form_cache_; | 174   FormCache form_cache_; | 
| 167 | 175 | 
| 168   PasswordAutofillManager* password_autofill_manager_;  // WEAK reference. | 176   PasswordAutofillManager* password_autofill_manager_;  // WEAK reference. | 
| 169 | 177 | 
| 170   // The ID of the last request sent for form field Autofill.  Used to ignore | 178   // The ID of the last request sent for form field Autofill.  Used to ignore | 
| 171   // out of date responses. | 179   // out of date responses. | 
| 172   int autofill_query_id_; | 180   int autofill_query_id_; | 
| 173 | 181 | 
| 174   // The element corresponding to the last request sent for form field Autofill. | 182   // The element corresponding to the last request sent for form field Autofill. | 
| 175   WebKit::WebInputElement element_; | 183   WebKit::WebInputElement element_; | 
| 176 | 184 | 
|  | 185   // The element corresponding to the last request sent for an interactive | 
|  | 186   // autocomplete. | 
|  | 187   WebKit::WebFormElement form_; | 
|  | 188 | 
| 177   // The action to take when receiving Autofill data from the AutofillManager. | 189   // The action to take when receiving Autofill data from the AutofillManager. | 
| 178   AutofillAction autofill_action_; | 190   AutofillAction autofill_action_; | 
| 179 | 191 | 
| 180   // Should we display a warning if autofill is disabled? | 192   // Should we display a warning if autofill is disabled? | 
| 181   bool display_warning_if_disabled_; | 193   bool display_warning_if_disabled_; | 
| 182 | 194 | 
| 183   // Was the query node autofilled prior to previewing the form? | 195   // Was the query node autofilled prior to previewing the form? | 
| 184   bool was_query_node_autofilled_; | 196   bool was_query_node_autofilled_; | 
| 185 | 197 | 
| 186   // Have we already shown Autofill suggestions for the field the user is | 198   // Have we already shown Autofill suggestions for the field the user is | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
| 198   FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, WaitUsername); | 210   FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, WaitUsername); | 
| 199   FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionAccept); | 211   FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionAccept); | 
| 200   FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionSelect); | 212   FRIEND_TEST_ALL_PREFIXES(PasswordAutofillManagerTest, SuggestionSelect); | 
| 201 | 213 | 
| 202   DISALLOW_COPY_AND_ASSIGN(AutofillAgent); | 214   DISALLOW_COPY_AND_ASSIGN(AutofillAgent); | 
| 203 }; | 215 }; | 
| 204 | 216 | 
| 205 }  // namespace autofill | 217 }  // namespace autofill | 
| 206 | 218 | 
| 207 #endif  // CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ | 219 #endif  // CHROME_RENDERER_AUTOFILL_AUTOFILL_AGENT_H_ | 
| OLD | NEW | 
|---|