| 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/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "chrome/browser/search_engines/template_url_id.h" | 16 #include "chrome/browser/search_engines/template_url_id.h" |
| 17 #include "content/browser/browser_thread.h" | 17 #include "content/browser/browser_thread.h" |
| 18 #include "sql/init_status.h" | 18 #include "sql/init_status.h" |
| 19 | 19 |
| 20 class AutofillChange; | 20 class AutofillChange; |
| 21 class AutofillProfile; | 21 class AutofillProfile; |
| 22 class CreditCard; | 22 class CreditCard; |
| 23 class GURL; | 23 class GURL; |
| 24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
| 25 struct IE7PasswordInfo; | 25 struct IE7PasswordInfo; |
| 26 #endif | 26 #endif |
| 27 class MessageLoop; | 27 class MessageLoop; |
| 28 class Profile; |
| 28 class SkBitmap; | 29 class SkBitmap; |
| 29 class Task; | 30 class Task; |
| 30 class TemplateURL; | 31 class TemplateURL; |
| 31 class WebDatabase; | 32 class WebDatabase; |
| 32 struct WebIntentServiceData; | 33 struct WebIntentServiceData; |
| 33 | 34 |
| 34 namespace base { | 35 namespace base { |
| 35 class Thread; | 36 class Thread; |
| 36 } | 37 } |
| 37 | 38 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 266 |
| 266 const U& arg2() const { return arg2_; } | 267 const U& arg2() const { return arg2_; } |
| 267 | 268 |
| 268 private: | 269 private: |
| 269 T arg1_; | 270 T arg1_; |
| 270 U arg2_; | 271 U arg2_; |
| 271 }; | 272 }; |
| 272 | 273 |
| 273 WebDataService(); | 274 WebDataService(); |
| 274 | 275 |
| 276 // Notifies listeners on the UI thread that multiple changes have been made to |
| 277 // to Autofill records of the database. |
| 278 // NOTE: This method is intended to be called from the DB thread. It |
| 279 // it asynchronously notifies listeners on the UI thread. |
| 280 // |profile| may be NULL for testing purposes. |
| 281 static void NotifyOfMultipleAutofillChanges(Profile* profile); |
| 282 |
| 275 // Initializes the web data service. Returns false on failure | 283 // Initializes the web data service. Returns false on failure |
| 276 // Takes the path of the profile directory as its argument. | 284 // Takes the path of the profile directory as its argument. |
| 277 bool Init(const FilePath& profile_path); | 285 bool Init(const FilePath& profile_path); |
| 278 | 286 |
| 279 // Shutdown the web data service. The service can no longer be used after this | 287 // Shutdown the web data service. The service can no longer be used after this |
| 280 // call. | 288 // call. |
| 281 void Shutdown(); | 289 void Shutdown(); |
| 282 | 290 |
| 283 // Returns false if Shutdown() has been called. | 291 // Returns false if Shutdown() has been called. |
| 284 bool IsRunning() const; | 292 bool IsRunning() const; |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 // result can be NULL, if no result is expected or if the database could | 705 // result can be NULL, if no result is expected or if the database could |
| 698 // not be opened. The result object is destroyed after this call. | 706 // not be opened. The result object is destroyed after this call. |
| 699 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, | 707 virtual void OnWebDataServiceRequestDone(WebDataService::Handle h, |
| 700 const WDTypedResult* result) = 0; | 708 const WDTypedResult* result) = 0; |
| 701 | 709 |
| 702 protected: | 710 protected: |
| 703 virtual ~WebDataServiceConsumer() {} | 711 virtual ~WebDataServiceConsumer() {} |
| 704 }; | 712 }; |
| 705 | 713 |
| 706 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ | 714 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
| OLD | NEW |