| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Chromium settings and storage represent user-selected preferences and | 5 // Chromium settings and storage represent user-selected preferences and |
| 6 // information and MUST not be extracted, overwritten or modified except | 6 // information and MUST not be extracted, overwritten or modified except |
| 7 // through Chromium defined APIs. | 7 // through Chromium defined APIs. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ | 9 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
| 10 #define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ | 10 #define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 class WebDataServiceConsumer; | 100 class WebDataServiceConsumer; |
| 101 | 101 |
| 102 class WebDataService | 102 class WebDataService |
| 103 : public WebDataServiceBase, | 103 : public WebDataServiceBase, |
| 104 public AutofillWebData { | 104 public AutofillWebData { |
| 105 public: | 105 public: |
| 106 // Retrieve a WebDataService for the given context. | 106 // Retrieve a WebDataService for the given context. |
| 107 static scoped_refptr<WebDataService> FromBrowserContext( | 107 static scoped_refptr<WebDataService> FromBrowserContext( |
| 108 content::BrowserContext* context); | 108 content::BrowserContext* context); |
| 109 | 109 |
| 110 WebDataService(const base::FilePath& path, | 110 WebDataService( |
| 111 const ProfileErrorCallback& callback); | 111 scoped_refptr<WebDatabaseService> wdbs, |
| 112 const ProfileErrorCallback& callback); |
| 112 | 113 |
| 113 // Notifies listeners on the UI thread that multiple changes have been made to | 114 // Notifies listeners on the UI thread that multiple changes have been made to |
| 114 // to Autofill records of the database. | 115 // to Autofill records of the database. |
| 115 // NOTE: This method is intended to be called from the DB thread. It | 116 // NOTE: This method is intended to be called from the DB thread. It |
| 116 // it asynchronously notifies listeners on the UI thread. | 117 // it asynchronously notifies listeners on the UI thread. |
| 117 // |web_data_service| may be NULL for testing purposes. | 118 // |web_data_service| may be NULL for testing purposes. |
| 118 static void NotifyOfMultipleAutofillChanges(WebDataService* web_data_service); | 119 static void NotifyOfMultipleAutofillChanges(WebDataService* web_data_service); |
| 119 | 120 |
| 120 | |
| 121 | |
| 122 ////////////////////////////////////////////////////////////////////////////// | 121 ////////////////////////////////////////////////////////////////////////////// |
| 123 // | 122 // |
| 124 // Keywords | 123 // Keywords |
| 125 // | 124 // |
| 126 ////////////////////////////////////////////////////////////////////////////// | 125 ////////////////////////////////////////////////////////////////////////////// |
| 127 | 126 |
| 128 // As the database processes requests at a later date, all deletion is | 127 // As the database processes requests at a later date, all deletion is |
| 129 // done on the background thread. | 128 // done on the background thread. |
| 130 // | 129 // |
| 131 // Many of the keyword related methods do not return a handle. This is because | 130 // Many of the keyword related methods do not return a handle. This is because |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 friend class WebDataRequest; | 293 friend class WebDataRequest; |
| 295 | 294 |
| 296 // For unit tests, passes a null callback. | 295 // For unit tests, passes a null callback. |
| 297 WebDataService(); | 296 WebDataService(); |
| 298 | 297 |
| 299 virtual ~WebDataService(); | 298 virtual ~WebDataService(); |
| 300 | 299 |
| 301 private: | 300 private: |
| 302 ////////////////////////////////////////////////////////////////////////////// | 301 ////////////////////////////////////////////////////////////////////////////// |
| 303 // | 302 // |
| 304 // The following methods are only invoked in the web data service thread. | 303 // The following methods are only invoked on the DB thread. |
| 305 // | 304 // |
| 306 ////////////////////////////////////////////////////////////////////////////// | 305 ////////////////////////////////////////////////////////////////////////////// |
| 307 | 306 |
| 308 ////////////////////////////////////////////////////////////////////////////// | 307 ////////////////////////////////////////////////////////////////////////////// |
| 309 // | 308 // |
| 310 // Keywords. | 309 // Keywords. |
| 311 // | 310 // |
| 312 ////////////////////////////////////////////////////////////////////////////// | 311 ////////////////////////////////////////////////////////////////////////////// |
| 313 WebDatabase::State AddKeywordImpl( | 312 WebDatabase::State AddKeywordImpl( |
| 314 const TemplateURLData& data, WebDatabase* db); | 313 const TemplateURLData& data, WebDatabase* db); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 | 419 |
| 421 // Callbacks to ensure that sensitive info is destroyed if request is | 420 // Callbacks to ensure that sensitive info is destroyed if request is |
| 422 // cancelled. | 421 // cancelled. |
| 423 void DestroyAutofillProfileResult(const WDTypedResult* result); | 422 void DestroyAutofillProfileResult(const WDTypedResult* result); |
| 424 void DestroyAutofillCreditCardResult(const WDTypedResult* result); | 423 void DestroyAutofillCreditCardResult(const WDTypedResult* result); |
| 425 | 424 |
| 426 DISALLOW_COPY_AND_ASSIGN(WebDataService); | 425 DISALLOW_COPY_AND_ASSIGN(WebDataService); |
| 427 }; | 426 }; |
| 428 | 427 |
| 429 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ | 428 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
| OLD | NEW |