Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: chrome/browser/webdata/web_data_service.h

Issue 12494020: Remove knowledge of Chrome-specific SyncableService classes from WebDataService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 explicit WebDataService(const ProfileErrorCallback& callback); 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;
115 114
116 // Notifies listeners on the UI thread that multiple changes have been made to 115 // Notifies listeners on the UI thread that multiple changes have been made to
117 // to Autofill records of the database. 116 // to Autofill records of the database.
118 // NOTE: This method is intended to be called from the DB thread. It 117 // NOTE: This method is intended to be called from the DB thread. It
119 // it asynchronously notifies listeners on the UI thread. 118 // it asynchronously notifies listeners on the UI thread.
120 // |web_data_service| may be NULL for testing purposes. 119 // |web_data_service| may be NULL for testing purposes.
121 static void NotifyOfMultipleAutofillChanges(WebDataService* web_data_service); 120 static void NotifyOfMultipleAutofillChanges(WebDataService* web_data_service);
122 121
123 122
124 123
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 300
302 protected: 301 protected:
303 // TODO (caitkp): We probably don't need these anymore. 302 // TODO (caitkp): We probably don't need these anymore.
304 friend class TemplateURLServiceTest; 303 friend class TemplateURLServiceTest;
305 friend class TemplateURLServiceTestingProfile; 304 friend class TemplateURLServiceTestingProfile;
306 friend class WebDataServiceTest; 305 friend class WebDataServiceTest;
307 friend class WebDataRequest; 306 friend class WebDataRequest;
308 307
309 virtual ~WebDataService(); 308 virtual ~WebDataService();
310 309
310 private:
311 ////////////////////////////////////////////////////////////////////////////// 311 //////////////////////////////////////////////////////////////////////////////
312 // 312 //
313 // The following methods are only invoked in the web data service thread. 313 // The following methods are only invoked in the web data service thread.
314 // 314 //
315 ////////////////////////////////////////////////////////////////////////////// 315 //////////////////////////////////////////////////////////////////////////////
316 private:
317 // Initialize any syncable services.
318 void InitializeSyncableServices();
319
320 // Deletes the syncable services.
321 void ShutdownSyncableServices();
322 316
323 ////////////////////////////////////////////////////////////////////////////// 317 //////////////////////////////////////////////////////////////////////////////
324 // 318 //
325 // Keywords. 319 // Keywords.
326 // 320 //
327 ////////////////////////////////////////////////////////////////////////////// 321 //////////////////////////////////////////////////////////////////////////////
328 WebDatabase::State AddKeywordImpl( 322 WebDatabase::State AddKeywordImpl(
329 const TemplateURLData& data, WebDatabase* db); 323 const TemplateURLData& data, WebDatabase* db);
330 WebDatabase::State RemoveKeywordImpl( 324 WebDatabase::State RemoveKeywordImpl(
331 TemplateURLID id, WebDatabase* db); 325 TemplateURLID id, WebDatabase* db);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 scoped_ptr<WDTypedResult> GetCreditCardsImpl(WebDatabase* db); 425 scoped_ptr<WDTypedResult> GetCreditCardsImpl(WebDatabase* db);
432 WebDatabase::State RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl( 426 WebDatabase::State RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl(
433 const base::Time& delete_begin, const base::Time& delete_end, 427 const base::Time& delete_begin, const base::Time& delete_end,
434 WebDatabase* db); 428 WebDatabase* db);
435 429
436 // Callbacks to ensure that sensitive info is destroyed if request is 430 // Callbacks to ensure that sensitive info is destroyed if request is
437 // cancelled. 431 // cancelled.
438 void DestroyAutofillProfileResult(const WDTypedResult* result); 432 void DestroyAutofillProfileResult(const WDTypedResult* result);
439 void DestroyAutofillCreditCardResult(const WDTypedResult* result); 433 void DestroyAutofillCreditCardResult(const WDTypedResult* result);
440 434
441 // Syncable services for the database data. We own the services, but don't
442 // use |scoped_ptr|s because the lifetimes must be managed on the database
443 // thread.
444 // Currently only Autocomplete and Autofill profiles use the new Sync API, but
445 // all the database data should migrate to this API over time.
446 AutocompleteSyncableService* autocomplete_syncable_service_;
447 AutofillProfileSyncableService* autofill_profile_syncable_service_;
448
449 DISALLOW_COPY_AND_ASSIGN(WebDataService); 435 DISALLOW_COPY_AND_ASSIGN(WebDataService);
450 }; 436 };
451 437
452 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ 438 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698