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(); | 110 explicit WebDataService(const ProfileErrorCallback& callback); |
111 | 111 |
112 // WebDataServiceBase implementation. | 112 // WebDataServiceBase implementation. |
113 virtual void ShutdownOnUIThread() OVERRIDE; | 113 virtual void ShutdownOnUIThread() OVERRIDE; |
114 virtual void Init(const base::FilePath& path) OVERRIDE; | 114 virtual void Init(const base::FilePath& path) OVERRIDE; |
115 | 115 |
116 // Notifies listeners on the UI thread that multiple changes have been made to | 116 // Notifies listeners on the UI thread that multiple changes have been made to |
117 // to Autofill records of the database. | 117 // to Autofill records of the database. |
118 // NOTE: This method is intended to be called from the DB thread. It | 118 // NOTE: This method is intended to be called from the DB thread. It |
119 // it asynchronously notifies listeners on the UI thread. | 119 // it asynchronously notifies listeners on the UI thread. |
120 // |web_data_service| may be NULL for testing purposes. | 120 // |web_data_service| may be NULL for testing purposes. |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 virtual AutocompleteSyncableService* | 299 virtual AutocompleteSyncableService* |
300 GetAutocompleteSyncableService() const; | 300 GetAutocompleteSyncableService() const; |
301 | 301 |
302 protected: | 302 protected: |
303 // TODO(caitkp): We probably don't need these anymore. | 303 // TODO(caitkp): We probably don't need these anymore. |
304 friend class TemplateURLServiceTest; | 304 friend class TemplateURLServiceTest; |
305 friend class TemplateURLServiceTestingProfile; | 305 friend class TemplateURLServiceTestingProfile; |
306 friend class WebDataServiceTest; | 306 friend class WebDataServiceTest; |
307 friend class WebDataRequest; | 307 friend class WebDataRequest; |
308 | 308 |
| 309 // For unit tests, passes a null callback. |
| 310 WebDataService(); |
| 311 |
309 virtual ~WebDataService(); | 312 virtual ~WebDataService(); |
310 | 313 |
311 ////////////////////////////////////////////////////////////////////////////// | 314 ////////////////////////////////////////////////////////////////////////////// |
312 // | 315 // |
313 // The following methods are only invoked in the web data service thread. | 316 // The following methods are only invoked in the web data service thread. |
314 // | 317 // |
315 ////////////////////////////////////////////////////////////////////////////// | 318 ////////////////////////////////////////////////////////////////////////////// |
316 private: | 319 private: |
317 // Initialize any syncable services. | 320 // Initialize any syncable services. |
318 void InitializeSyncableServices(); | 321 void InitializeSyncableServices(); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 // thread. | 446 // thread. |
444 // Currently only Autocomplete and Autofill profiles use the new Sync API, but | 447 // Currently only Autocomplete and Autofill profiles use the new Sync API, but |
445 // all the database data should migrate to this API over time. | 448 // all the database data should migrate to this API over time. |
446 AutocompleteSyncableService* autocomplete_syncable_service_; | 449 AutocompleteSyncableService* autocomplete_syncable_service_; |
447 AutofillProfileSyncableService* autofill_profile_syncable_service_; | 450 AutofillProfileSyncableService* autofill_profile_syncable_service_; |
448 | 451 |
449 DISALLOW_COPY_AND_ASSIGN(WebDataService); | 452 DISALLOW_COPY_AND_ASSIGN(WebDataService); |
450 }; | 453 }; |
451 | 454 |
452 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ | 455 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ |
OLD | NEW |