| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/location.h" | 15 #include "base/location.h" |
| 16 #include "base/message_loop_helpers.h" | 16 #include "base/message_loop_helpers.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 19 #include "chrome/browser/search_engines/template_url_id.h" | 19 #include "chrome/browser/search_engines/template_url_id.h" |
| 20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 21 #include "sql/init_status.h" | 21 #include "sql/init_status.h" |
| 22 | 22 |
| 23 class AutocompleteSyncableService; | 23 class AutocompleteSyncableService; |
| 24 class AutofillChange; | 24 class AutofillChange; |
| 25 class AutofillProfile; | 25 class AutofillProfile; |
| 26 class AutofillProfileSyncableService; | 26 class AutofillProfileSyncableService; |
| 27 class CreditCard; | 27 class CreditCard; |
| 28 struct DefaultWebIntentService; |
| 28 class GURL; | 29 class GURL; |
| 29 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
| 30 struct IE7PasswordInfo; | 31 struct IE7PasswordInfo; |
| 31 #endif | 32 #endif |
| 32 class MessageLoop; | 33 class MessageLoop; |
| 33 class Profile; | 34 class Profile; |
| 34 class SkBitmap; | 35 class SkBitmap; |
| 35 class TemplateURL; | 36 class TemplateURL; |
| 36 class WebDatabase; | 37 class WebDatabase; |
| 37 | 38 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 PASSWORD_IE7_RESULT, // WDResult<IE7PasswordInfo> | 79 PASSWORD_IE7_RESULT, // WDResult<IE7PasswordInfo> |
| 79 #endif | 80 #endif |
| 80 WEB_APP_IMAGES, // WDResult<WDAppImagesResult> | 81 WEB_APP_IMAGES, // WDResult<WDAppImagesResult> |
| 81 TOKEN_RESULT, // WDResult<std::vector<std::string>> | 82 TOKEN_RESULT, // WDResult<std::vector<std::string>> |
| 82 AUTOFILL_VALUE_RESULT, // WDResult<std::vector<string16>> | 83 AUTOFILL_VALUE_RESULT, // WDResult<std::vector<string16>> |
| 83 AUTOFILL_CHANGES, // WDResult<std::vector<AutofillChange>> | 84 AUTOFILL_CHANGES, // WDResult<std::vector<AutofillChange>> |
| 84 AUTOFILL_PROFILE_RESULT, // WDResult<AutofillProfile> | 85 AUTOFILL_PROFILE_RESULT, // WDResult<AutofillProfile> |
| 85 AUTOFILL_PROFILES_RESULT, // WDResult<std::vector<AutofillProfile*>> | 86 AUTOFILL_PROFILES_RESULT, // WDResult<std::vector<AutofillProfile*>> |
| 86 AUTOFILL_CREDITCARD_RESULT, // WDResult<CreditCard> | 87 AUTOFILL_CREDITCARD_RESULT, // WDResult<CreditCard> |
| 87 AUTOFILL_CREDITCARDS_RESULT, // WDResult<std::vector<CreditCard*>> | 88 AUTOFILL_CREDITCARDS_RESULT, // WDResult<std::vector<CreditCard*>> |
| 88 WEB_INTENTS_RESULT // WDResult<std::vector<string16>> | 89 WEB_INTENTS_RESULT, // WDResult<std::vector<WebIntentServiceData>> |
| 90 WEB_INTENTS_DEFAULTS_RESULT, // WDResult<std::vector<DefaultWebIntentService>> |
| 89 } WDResultType; | 91 } WDResultType; |
| 90 | 92 |
| 91 typedef std::vector<AutofillChange> AutofillChangeList; | 93 typedef std::vector<AutofillChange> AutofillChangeList; |
| 92 | 94 |
| 93 // Result from GetWebAppImages. | 95 // Result from GetWebAppImages. |
| 94 struct WDAppImagesResult { | 96 struct WDAppImagesResult { |
| 95 WDAppImagesResult(); | 97 WDAppImagesResult(); |
| 96 ~WDAppImagesResult(); | 98 ~WDAppImagesResult(); |
| 97 | 99 |
| 98 // True if SetWebAppHasAllImages(true) was invoked. | 100 // True if SetWebAppHasAllImages(true) was invoked. |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 WebDataServiceConsumer* consumer); | 385 WebDataServiceConsumer* consumer); |
| 384 | 386 |
| 385 // Get all web intent services registered using the specified |service_url|. | 387 // Get all web intent services registered using the specified |service_url|. |
| 386 // |consumer| must not be NULL. | 388 // |consumer| must not be NULL. |
| 387 Handle GetWebIntentServicesForURL(const string16& service_url, | 389 Handle GetWebIntentServicesForURL(const string16& service_url, |
| 388 WebDataServiceConsumer* consumer); | 390 WebDataServiceConsumer* consumer); |
| 389 | 391 |
| 390 // Get all web intent services registered. |consumer| must not be NULL. | 392 // Get all web intent services registered. |consumer| must not be NULL. |
| 391 Handle GetAllWebIntentServices(WebDataServiceConsumer* consumer); | 393 Handle GetAllWebIntentServices(WebDataServiceConsumer* consumer); |
| 392 | 394 |
| 395 // Adds a default web intent service entry. |
| 396 void AddDefaultWebIntentService(const DefaultWebIntentService& service); |
| 397 |
| 398 // Adds a default web intent service entry. |
| 399 void RemoveDefaultWebIntentService(const DefaultWebIntentService& service); |
| 400 |
| 401 // Get a list of all web intent service defaults for the given |action|. |
| 402 // |consumer| must not be null. |
| 403 Handle GetDefaultWebIntentServicesForAction(const string16& action, |
| 404 WebDataServiceConsumer* consumer); |
| 405 |
| 406 // Get a list of all registered web intent service defaults. |
| 407 // |consumer| must not be null. |
| 408 Handle GetAllDefaultWebIntentServices(WebDataServiceConsumer* consumer); |
| 409 |
| 410 |
| 393 ////////////////////////////////////////////////////////////////////////////// | 411 ////////////////////////////////////////////////////////////////////////////// |
| 394 // | 412 // |
| 395 // Token Service | 413 // Token Service |
| 396 // | 414 // |
| 397 ////////////////////////////////////////////////////////////////////////////// | 415 ////////////////////////////////////////////////////////////////////////////// |
| 398 | 416 |
| 399 // Set a token to use for a specified service. | 417 // Set a token to use for a specified service. |
| 400 void SetTokenForService(const std::string& service, | 418 void SetTokenForService(const std::string& service, |
| 401 const std::string& token); | 419 const std::string& token); |
| 402 | 420 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 // Web Intents. | 653 // Web Intents. |
| 636 // | 654 // |
| 637 ////////////////////////////////////////////////////////////////////////////// | 655 ////////////////////////////////////////////////////////////////////////////// |
| 638 void AddWebIntentServiceImpl( | 656 void AddWebIntentServiceImpl( |
| 639 GenericRequest<webkit_glue::WebIntentServiceData>* request); | 657 GenericRequest<webkit_glue::WebIntentServiceData>* request); |
| 640 void RemoveWebIntentServiceImpl( | 658 void RemoveWebIntentServiceImpl( |
| 641 GenericRequest<webkit_glue::WebIntentServiceData>* request); | 659 GenericRequest<webkit_glue::WebIntentServiceData>* request); |
| 642 void GetWebIntentServicesImpl(GenericRequest<string16>* request); | 660 void GetWebIntentServicesImpl(GenericRequest<string16>* request); |
| 643 void GetWebIntentServicesForURLImpl(GenericRequest<string16>* request); | 661 void GetWebIntentServicesForURLImpl(GenericRequest<string16>* request); |
| 644 void GetAllWebIntentServicesImpl(GenericRequest<std::string>* request); | 662 void GetAllWebIntentServicesImpl(GenericRequest<std::string>* request); |
| 663 void AddDefaultWebIntentServiceImpl( |
| 664 GenericRequest<DefaultWebIntentService>* request); |
| 665 void RemoveDefaultWebIntentServiceImpl( |
| 666 GenericRequest<DefaultWebIntentService>* request); |
| 667 void GetDefaultWebIntentServicesForActionImpl( |
| 668 GenericRequest<string16>* request); |
| 669 void GetAllDefaultWebIntentServicesImpl(GenericRequest<std::string>* request); |
| 645 | 670 |
| 646 ////////////////////////////////////////////////////////////////////////////// | 671 ////////////////////////////////////////////////////////////////////////////// |
| 647 // | 672 // |
| 648 // Token Service. | 673 // Token Service. |
| 649 // | 674 // |
| 650 ////////////////////////////////////////////////////////////////////////////// | 675 ////////////////////////////////////////////////////////////////////////////// |
| 651 | 676 |
| 652 void RemoveAllTokensImpl(GenericRequest<std::string>* request); | 677 void RemoveAllTokensImpl(GenericRequest<std::string>* request); |
| 653 void SetTokenForServiceImpl( | 678 void SetTokenForServiceImpl( |
| 654 GenericRequest2<std::string, std::string>* request); | 679 GenericRequest2<std::string, std::string>* request); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 // result can be NULL, if no result is expected or if the database could | 779 // result can be NULL, if no result is expected or if the database could |
| 755 // not be opened. The result object is destroyed after this call. | 780 // not be opened. The result object is destroyed after this call. |
| 756 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, | 781 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, |
| 757 const WDTypedResult* result) = 0; | 782 const WDTypedResult* result) = 0; |
| 758 | 783 |
| 759 protected: | 784 protected: |
| 760 virtual ~WebDataServiceConsumer() {} | 785 virtual ~WebDataServiceConsumer() {} |
| 761 }; | 786 }; |
| 762 | 787 |
| 763 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ | 788 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
| OLD | NEW |