| Index: chrome/browser/webdata/web_data_service.h
|
| diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h
|
| index 004532a00bfc1ed205d219f97f1d593ee9c52dba..5512c7803be29d5df02b88d28a93faf1437ad9fc 100644
|
| --- a/chrome/browser/webdata/web_data_service.h
|
| +++ b/chrome/browser/webdata/web_data_service.h
|
| @@ -156,27 +156,9 @@ class WebDataService
|
| : public base::RefCountedThreadSafe<WebDataService,
|
| ChromeThread::DeleteOnUIThread> {
|
| public:
|
| -
|
| // All requests return an opaque handle of the following type.
|
| typedef int Handle;
|
|
|
| - WebDataService();
|
| -
|
| - // Initializes the web data service. Returns false on failure
|
| - // Takes the path of the profile directory as its argument.
|
| - bool Init(const FilePath& profile_path);
|
| -
|
| - // Shutdown the web data service. The service can no longer be used after this
|
| - // call.
|
| - void Shutdown();
|
| -
|
| - // Returns false if Shutdown() has been called.
|
| - bool IsRunning() const;
|
| -
|
| - // Unloads the database without actually shutting down the service. This can
|
| - // be used to temporarily reduce the browser process' memory footprint.
|
| - void UnloadDatabase();
|
| -
|
| //////////////////////////////////////////////////////////////////////////////
|
| //
|
| // Internal requests
|
| @@ -273,6 +255,30 @@ class WebDataService
|
| U arg2_;
|
| };
|
|
|
| + WebDataService();
|
| +
|
| + // Initializes the web data service. Returns false on failure
|
| + // Takes the path of the profile directory as its argument.
|
| + bool Init(const FilePath& profile_path);
|
| +
|
| + // Shutdown the web data service. The service can no longer be used after this
|
| + // call.
|
| + void Shutdown();
|
| +
|
| + // Returns false if Shutdown() has been called.
|
| + bool IsRunning() const;
|
| +
|
| + // Unloads the database without actually shutting down the service. This can
|
| + // be used to temporarily reduce the browser process' memory footprint.
|
| + void UnloadDatabase();
|
| +
|
| + // Cancel any pending request. You need to call this method if your
|
| + // WebDataServiceConsumer is about to be deleted.
|
| + void CancelRequest(Handle h);
|
| +
|
| + virtual bool IsDatabaseLoaded();
|
| + virtual WebDatabase* GetDatabase();
|
| +
|
| //////////////////////////////////////////////////////////////////////////////
|
| //
|
| // Keywords
|
| @@ -331,12 +337,12 @@ class WebDataService
|
| //
|
| //////////////////////////////////////////////////////////////////////////////
|
|
|
| - // Updates the remembered password form.
|
| - void UpdateLogin(const webkit_glue::PasswordForm& form);
|
| -
|
| // Adds |form| to the list of remembered password forms.
|
| void AddLogin(const webkit_glue::PasswordForm& form);
|
|
|
| + // Updates the remembered password form.
|
| + void UpdateLogin(const webkit_glue::PasswordForm& form);
|
| +
|
| // Removes |form| from the list of remembered password forms.
|
| void RemoveLogin(const webkit_glue::PasswordForm& form);
|
|
|
| @@ -382,19 +388,14 @@ class WebDataService
|
| WebDataServiceConsumer* consumer);
|
| #endif // defined(OS_WIN)
|
|
|
| - // Cancel any pending request. You need to call this method if your
|
| - // WebDataServiceConsumer is about to be deleted.
|
| - void CancelRequest(Handle h);
|
| -
|
| //////////////////////////////////////////////////////////////////////////////
|
| //
|
| - // Autofill.
|
| + // AutoFill.
|
| //
|
| //////////////////////////////////////////////////////////////////////////////
|
|
|
| - // Schedules a task to add form elements to the web database.
|
| - void AddFormFieldValues(
|
| - const std::vector<webkit_glue::FormField>& elements);
|
| + // Schedules a task to add form fields to the web database.
|
| + void AddFormFields(const std::vector<webkit_glue::FormField>& fields);
|
|
|
| // Initiates the request for a vector of values which have been entered in
|
| // form input fields named |name|. The method OnWebDataServiceRequestDone of
|
| @@ -405,7 +406,7 @@ class WebDataService
|
| int limit,
|
| WebDataServiceConsumer* consumer);
|
|
|
| - // Removes form elements recorded for autofill from the database.
|
| + // Removes form elements recorded for Autocomplete from the database.
|
| void RemoveFormElementsAddedBetween(const base::Time& delete_begin,
|
| const base::Time& delete_end);
|
| void RemoveFormValueForElementName(const string16& name,
|
| @@ -448,17 +449,14 @@ class WebDataService
|
| void set_failed_init(bool value) { failed_init_ = value; }
|
| #endif
|
|
|
| - virtual bool IsDatabaseLoaded();
|
| - virtual WebDatabase* GetDatabase();
|
| -
|
| protected:
|
| - virtual ~WebDataService();
|
| -
|
| friend class TemplateURLModelTest;
|
| friend class TemplateURLModelTestingProfile;
|
| friend class WebDataServiceTest;
|
| friend class WebDataRequest;
|
|
|
| + virtual ~WebDataService();
|
| +
|
| // This is invoked by the unit test; path is the path of the Web Data file.
|
| bool InitWithPath(const FilePath& path);
|
|
|
| @@ -497,6 +495,15 @@ class WebDataService
|
| // Commit the current transaction and creates a new one.
|
| void Commit();
|
|
|
| + // Schedule a task on our worker thread.
|
| + void ScheduleTask(Task* t);
|
| +
|
| + // Schedule a commit if one is not already pending.
|
| + void ScheduleCommit();
|
| +
|
| + // Return the next request handle.
|
| + int GetNextRequestHandle();
|
| +
|
| //////////////////////////////////////////////////////////////////////////////
|
| //
|
| // Keywords.
|
| @@ -511,6 +518,16 @@ class WebDataService
|
|
|
| //////////////////////////////////////////////////////////////////////////////
|
| //
|
| + // Web Apps.
|
| + //
|
| + //////////////////////////////////////////////////////////////////////////////
|
| + void SetWebAppImageImpl(GenericRequest2<GURL, SkBitmap>* request);
|
| + void SetWebAppHasAllImagesImpl(GenericRequest2<GURL, bool>* request);
|
| + void RemoveWebAppImpl(GenericRequest<GURL>* request);
|
| + void GetWebAppImagesImpl(GenericRequest<GURL>* request);
|
| +
|
| + //////////////////////////////////////////////////////////////////////////////
|
| + //
|
| // Password manager.
|
| //
|
| //////////////////////////////////////////////////////////////////////////////
|
| @@ -530,10 +547,10 @@ class WebDataService
|
|
|
| //////////////////////////////////////////////////////////////////////////////
|
| //
|
| - // Autofill.
|
| + // AutoFill.
|
| //
|
| //////////////////////////////////////////////////////////////////////////////
|
| - void AddFormFieldValuesImpl(
|
| + void AddFormElementsImpl(
|
| GenericRequest<std::vector<webkit_glue::FormField> >* request);
|
| void GetFormValuesForElementNameImpl(WebDataRequest* request,
|
| const string16& name, const string16& prefix, int limit);
|
| @@ -544,39 +561,12 @@ class WebDataService
|
| void AddAutoFillProfileImpl(GenericRequest<AutoFillProfile>* request);
|
| void UpdateAutoFillProfileImpl(GenericRequest<AutoFillProfile>* request);
|
| void RemoveAutoFillProfileImpl(GenericRequest<int>* request);
|
| - void GetAutoFillProfileForLabelImpl(WebDataRequest* request,
|
| - const string16& label);
|
| void GetAutoFillProfilesImpl(WebDataRequest* request);
|
| void AddCreditCardImpl(GenericRequest<CreditCard>* request);
|
| void UpdateCreditCardImpl(GenericRequest<CreditCard>* request);
|
| void RemoveCreditCardImpl(GenericRequest<int>* request);
|
| - void GetCreditCardForLabelImpl(WebDataRequest* request,
|
| - const string16& label);
|
| void GetCreditCardsImpl(WebDataRequest* request);
|
|
|
| - //////////////////////////////////////////////////////////////////////////////
|
| - //
|
| - // Web Apps.
|
| - //
|
| - //////////////////////////////////////////////////////////////////////////////
|
| -
|
| - void SetWebAppImageImpl(GenericRequest2<GURL, SkBitmap>* request);
|
| -
|
| - void SetWebAppHasAllImagesImpl(GenericRequest2<GURL, bool>* request);
|
| -
|
| - void RemoveWebAppImpl(GenericRequest<GURL>* request);
|
| -
|
| - void GetWebAppImagesImpl(GenericRequest<GURL>* request);
|
| -
|
| - // Schedule a task on our worker thread.
|
| - void ScheduleTask(Task* t);
|
| -
|
| - // Schedule a commit if one is not already pending.
|
| - void ScheduleCommit();
|
| -
|
| - // Return the next request handle.
|
| - int GetNextRequestHandle();
|
| -
|
| // True once initialization has started.
|
| bool is_running_;
|
|
|
|
|