| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_BROWSER_AUTOFILL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_MANAGER_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_MANAGER_H_ | 6 #define CHROME_BROWSER_AUTOFILL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 10 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class AutofillManager : public RenderViewHostDelegate::Autofill, | 23 class AutofillManager : public RenderViewHostDelegate::Autofill, |
| 24 public WebDataServiceConsumer { | 24 public WebDataServiceConsumer { |
| 25 public: | 25 public: |
| 26 explicit AutofillManager(TabContents* tab_contents); | 26 explicit AutofillManager(TabContents* tab_contents); |
| 27 virtual ~AutofillManager(); | 27 virtual ~AutofillManager(); |
| 28 | 28 |
| 29 Profile* profile(); | 29 Profile* profile(); |
| 30 | 30 |
| 31 // RenderViewHostDelegate::Autofill implementation. | 31 // RenderViewHostDelegate::Autofill implementation. |
| 32 virtual void AutofillFormSubmitted(const webkit_glue::AutofillForm& form); | 32 virtual void AutofillFormSubmitted(const webkit_glue::AutofillForm& form); |
| 33 virtual bool GetAutofillSuggestions(int request_id, | 33 virtual bool GetAutofillSuggestions(int query_id, |
| 34 const std::wstring& name, | 34 const string16& name, |
| 35 const std::wstring& prefix); | 35 const string16& prefix); |
| 36 virtual void RemoveAutofillEntry(const std::wstring& name, | 36 virtual void RemoveAutofillEntry(const string16& name, |
| 37 const std::wstring& value); | 37 const string16& value); |
| 38 | 38 |
| 39 // WebDataServiceConsumer implementation. | 39 // WebDataServiceConsumer implementation. |
| 40 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, | 40 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, |
| 41 const WDTypedResult* result); | 41 const WDTypedResult* result); |
| 42 | 42 |
| 43 static void RegisterUserPrefs(PrefService* prefs); | 43 static void RegisterUserPrefs(PrefService* prefs); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 void CancelPendingQuery(); | 46 void CancelPendingQuery(); |
| 47 void StoreFormEntriesInWebDatabase(const webkit_glue::AutofillForm& form); | 47 void StoreFormEntriesInWebDatabase(const webkit_glue::AutofillForm& form); |
| 48 void SendSuggestions(const WDTypedResult* suggestions); | 48 void SendSuggestions(const WDTypedResult* suggestions); |
| 49 | 49 |
| 50 TabContents* tab_contents_; | 50 TabContents* tab_contents_; |
| 51 | 51 |
| 52 BooleanPrefMember form_autofill_enabled_; | 52 BooleanPrefMember form_autofill_enabled_; |
| 53 | 53 |
| 54 // When the manager makes a request from WebDataService, the database | 54 // When the manager makes a request from WebDataService, the database |
| 55 // is queried on another thread, we record the query handle until we | 55 // is queried on another thread, we record the query handle until we |
| 56 // get called back. | 56 // get called back. |
| 57 WebDataService::Handle pending_query_handle_; | 57 WebDataService::Handle pending_query_handle_; |
| 58 int request_id_; | 58 int query_id_; |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 60 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 #endif // CHROME_BROWSER_AUTOFILL_MANAGER_H_ | 63 #endif // CHROME_BROWSER_AUTOFILL_MANAGER_H_ |
| OLD | NEW |