OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WEBDATA_WEB_DATA_SERVICE_H__ | 5 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
6 #define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ | 6 #define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 20 matching lines...) Expand all Loading... |
31 class MessageLoop; | 31 class MessageLoop; |
32 class Profile; | 32 class Profile; |
33 class SkBitmap; | 33 class SkBitmap; |
34 class TemplateURL; | 34 class TemplateURL; |
35 class WebDatabase; | 35 class WebDatabase; |
36 | 36 |
37 namespace base { | 37 namespace base { |
38 class Thread; | 38 class Thread; |
39 } | 39 } |
40 | 40 |
41 namespace webkit_glue { | 41 namespace webkit { |
| 42 namespace forms { |
42 struct FormField; | 43 struct FormField; |
43 struct PasswordForm; | 44 struct PasswordForm; |
| 45 } |
| 46 } |
| 47 |
| 48 namespace webkit_glue { |
44 struct WebIntentServiceData; | 49 struct WebIntentServiceData; |
45 } | 50 } |
46 | 51 |
47 //////////////////////////////////////////////////////////////////////////////// | 52 //////////////////////////////////////////////////////////////////////////////// |
48 // | 53 // |
49 // WebDataService is a generic data repository for meta data associated with | 54 // WebDataService is a generic data repository for meta data associated with |
50 // web pages. All data is retrieved and archived in an asynchronous way. | 55 // web pages. All data is retrieved and archived in an asynchronous way. |
51 // | 56 // |
52 // All requests return a handle. The handle can be used to cancel the request. | 57 // All requests return a handle. The handle can be used to cancel the request. |
53 // | 58 // |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 ////////////////////////////////////////////////////////////////////////////// | 408 ////////////////////////////////////////////////////////////////////////////// |
404 // | 409 // |
405 // Password manager | 410 // Password manager |
406 // NOTE: These methods are all deprecated; new clients should use | 411 // NOTE: These methods are all deprecated; new clients should use |
407 // PasswordStore. These are only still here because Windows is (temporarily) | 412 // PasswordStore. These are only still here because Windows is (temporarily) |
408 // still using them for its PasswordStore implementation. | 413 // still using them for its PasswordStore implementation. |
409 // | 414 // |
410 ////////////////////////////////////////////////////////////////////////////// | 415 ////////////////////////////////////////////////////////////////////////////// |
411 | 416 |
412 // Adds |form| to the list of remembered password forms. | 417 // Adds |form| to the list of remembered password forms. |
413 void AddLogin(const webkit_glue::PasswordForm& form); | 418 void AddLogin(const webkit::forms::PasswordForm& form); |
414 | 419 |
415 // Updates the remembered password form. | 420 // Updates the remembered password form. |
416 void UpdateLogin(const webkit_glue::PasswordForm& form); | 421 void UpdateLogin(const webkit::forms::PasswordForm& form); |
417 | 422 |
418 // Removes |form| from the list of remembered password forms. | 423 // Removes |form| from the list of remembered password forms. |
419 void RemoveLogin(const webkit_glue::PasswordForm& form); | 424 void RemoveLogin(const webkit::forms::PasswordForm& form); |
420 | 425 |
421 // Removes all logins created in the specified daterange | 426 // Removes all logins created in the specified daterange |
422 void RemoveLoginsCreatedBetween(const base::Time& delete_begin, | 427 void RemoveLoginsCreatedBetween(const base::Time& delete_begin, |
423 const base::Time& delete_end); | 428 const base::Time& delete_end); |
424 | 429 |
425 // Removes all logins created on or after the date passed in. | 430 // Removes all logins created on or after the date passed in. |
426 void RemoveLoginsCreatedAfter(const base::Time& delete_begin); | 431 void RemoveLoginsCreatedAfter(const base::Time& delete_begin); |
427 | 432 |
428 // Gets a list of password forms that match |form|. | 433 // Gets a list of password forms that match |form|. |
429 // |consumer| will be notified when the request is done. The result is of | 434 // |consumer| will be notified when the request is done. The result is of |
430 // type WDResult<std::vector<PasswordForm*>>. | 435 // type WDResult<std::vector<PasswordForm*>>. |
431 // The result will be null on failure. The |consumer| owns all PasswordForm's. | 436 // The result will be null on failure. The |consumer| owns all PasswordForm's. |
432 Handle GetLogins(const webkit_glue::PasswordForm& form, | 437 Handle GetLogins(const webkit::forms::PasswordForm& form, |
433 WebDataServiceConsumer* consumer); | 438 WebDataServiceConsumer* consumer); |
434 | 439 |
435 // Gets the complete list of password forms that have not been blacklisted and | 440 // Gets the complete list of password forms that have not been blacklisted and |
436 // are thus auto-fillable. | 441 // are thus auto-fillable. |
437 // |consumer| will be notified when the request is done. The result is of | 442 // |consumer| will be notified when the request is done. The result is of |
438 // type WDResult<std::vector<PasswordForm*>>. | 443 // type WDResult<std::vector<PasswordForm*>>. |
439 // The result will be null on failure. The |consumer| owns all PasswordForms. | 444 // The result will be null on failure. The |consumer| owns all PasswordForms. |
440 Handle GetAutofillableLogins(WebDataServiceConsumer* consumer); | 445 Handle GetAutofillableLogins(WebDataServiceConsumer* consumer); |
441 | 446 |
442 // Gets the complete list of password forms that have been blacklisted. | 447 // Gets the complete list of password forms that have been blacklisted. |
(...skipping 17 matching lines...) Expand all Loading... |
460 WebDataServiceConsumer* consumer); | 465 WebDataServiceConsumer* consumer); |
461 #endif // defined(OS_WIN) | 466 #endif // defined(OS_WIN) |
462 | 467 |
463 ////////////////////////////////////////////////////////////////////////////// | 468 ////////////////////////////////////////////////////////////////////////////// |
464 // | 469 // |
465 // Autofill. | 470 // Autofill. |
466 // | 471 // |
467 ////////////////////////////////////////////////////////////////////////////// | 472 ////////////////////////////////////////////////////////////////////////////// |
468 | 473 |
469 // Schedules a task to add form fields to the web database. | 474 // Schedules a task to add form fields to the web database. |
470 virtual void AddFormFields(const std::vector<webkit_glue::FormField>& fields); | 475 virtual void AddFormFields( |
| 476 const std::vector<webkit::forms::FormField>& fields); |
471 | 477 |
472 // Initiates the request for a vector of values which have been entered in | 478 // Initiates the request for a vector of values which have been entered in |
473 // form input fields named |name|. The method OnWebDataServiceRequestDone of | 479 // form input fields named |name|. The method OnWebDataServiceRequestDone of |
474 // |consumer| gets called back when the request is finished, with the vector | 480 // |consumer| gets called back when the request is finished, with the vector |
475 // included in the argument |result|. | 481 // included in the argument |result|. |
476 Handle GetFormValuesForElementName(const string16& name, | 482 Handle GetFormValuesForElementName(const string16& name, |
477 const string16& prefix, | 483 const string16& prefix, |
478 int limit, | 484 int limit, |
479 WebDataServiceConsumer* consumer); | 485 WebDataServiceConsumer* consumer); |
480 | 486 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 void RemoveAllTokensImpl(GenericRequest<std::string>* request); | 652 void RemoveAllTokensImpl(GenericRequest<std::string>* request); |
647 void SetTokenForServiceImpl( | 653 void SetTokenForServiceImpl( |
648 GenericRequest2<std::string, std::string>* request); | 654 GenericRequest2<std::string, std::string>* request); |
649 void GetAllTokensImpl(GenericRequest<std::string>* request); | 655 void GetAllTokensImpl(GenericRequest<std::string>* request); |
650 | 656 |
651 ////////////////////////////////////////////////////////////////////////////// | 657 ////////////////////////////////////////////////////////////////////////////// |
652 // | 658 // |
653 // Password manager. | 659 // Password manager. |
654 // | 660 // |
655 ////////////////////////////////////////////////////////////////////////////// | 661 ////////////////////////////////////////////////////////////////////////////// |
656 void AddLoginImpl(GenericRequest<webkit_glue::PasswordForm>* request); | 662 void AddLoginImpl(GenericRequest<webkit::forms::PasswordForm>* request); |
657 void UpdateLoginImpl(GenericRequest<webkit_glue::PasswordForm>* request); | 663 void UpdateLoginImpl(GenericRequest<webkit::forms::PasswordForm>* request); |
658 void RemoveLoginImpl(GenericRequest<webkit_glue::PasswordForm>* request); | 664 void RemoveLoginImpl(GenericRequest<webkit::forms::PasswordForm>* request); |
659 void RemoveLoginsCreatedBetweenImpl( | 665 void RemoveLoginsCreatedBetweenImpl( |
660 GenericRequest2<base::Time, base::Time>* request); | 666 GenericRequest2<base::Time, base::Time>* request); |
661 void GetLoginsImpl(GenericRequest<webkit_glue::PasswordForm>* request); | 667 void GetLoginsImpl(GenericRequest<webkit::forms::PasswordForm>* request); |
662 void GetAutofillableLoginsImpl(WebDataRequest* request); | 668 void GetAutofillableLoginsImpl(WebDataRequest* request); |
663 void GetBlacklistLoginsImpl(WebDataRequest* request); | 669 void GetBlacklistLoginsImpl(WebDataRequest* request); |
664 #if defined(OS_WIN) | 670 #if defined(OS_WIN) |
665 void AddIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); | 671 void AddIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); |
666 void RemoveIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); | 672 void RemoveIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); |
667 void GetIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); | 673 void GetIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); |
668 #endif // defined(OS_WIN) | 674 #endif // defined(OS_WIN) |
669 | 675 |
670 ////////////////////////////////////////////////////////////////////////////// | 676 ////////////////////////////////////////////////////////////////////////////// |
671 // | 677 // |
672 // Autofill. | 678 // Autofill. |
673 // | 679 // |
674 ////////////////////////////////////////////////////////////////////////////// | 680 ////////////////////////////////////////////////////////////////////////////// |
675 void AddFormElementsImpl( | 681 void AddFormElementsImpl( |
676 GenericRequest<std::vector<webkit_glue::FormField> >* request); | 682 GenericRequest<std::vector<webkit::forms::FormField> >* request); |
677 void GetFormValuesForElementNameImpl(WebDataRequest* request, | 683 void GetFormValuesForElementNameImpl(WebDataRequest* request, |
678 const string16& name, const string16& prefix, int limit); | 684 const string16& name, const string16& prefix, int limit); |
679 void RemoveFormElementsAddedBetweenImpl( | 685 void RemoveFormElementsAddedBetweenImpl( |
680 GenericRequest2<base::Time, base::Time>* request); | 686 GenericRequest2<base::Time, base::Time>* request); |
681 void RemoveFormValueForElementNameImpl( | 687 void RemoveFormValueForElementNameImpl( |
682 GenericRequest2<string16, string16>* request); | 688 GenericRequest2<string16, string16>* request); |
683 void AddAutofillProfileImpl(GenericRequest<AutofillProfile>* request); | 689 void AddAutofillProfileImpl(GenericRequest<AutofillProfile>* request); |
684 void UpdateAutofillProfileImpl(GenericRequest<AutofillProfile>* request); | 690 void UpdateAutofillProfileImpl(GenericRequest<AutofillProfile>* request); |
685 void RemoveAutofillProfileImpl(GenericRequest<std::string>* request); | 691 void RemoveAutofillProfileImpl(GenericRequest<std::string>* request); |
686 void GetAutofillProfilesImpl(WebDataRequest* request); | 692 void GetAutofillProfilesImpl(WebDataRequest* request); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 // result can be NULL, if no result is expected or if the database could | 754 // result can be NULL, if no result is expected or if the database could |
749 // not be opened. The result object is destroyed after this call. | 755 // not be opened. The result object is destroyed after this call. |
750 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, | 756 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, |
751 const WDTypedResult* result) = 0; | 757 const WDTypedResult* result) = 0; |
752 | 758 |
753 protected: | 759 protected: |
754 virtual ~WebDataServiceConsumer() {} | 760 virtual ~WebDataServiceConsumer() {} |
755 }; | 761 }; |
756 | 762 |
757 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ | 763 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
OLD | NEW |