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

Side by Side Diff: chrome/browser/sync/glue/autofill_profile_data_type_controller.h

Issue 8274020: Revert 105404 - [Sync] Refactor non-frontend DTC to handle new API properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 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) 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_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "chrome/browser/sync/glue/autofill_data_type_controller.h"
10 #include "base/memory/ref_counted.h" 10 #include "chrome/browser/sync/profile_sync_factory.h"
11 #include "chrome/browser/autofill/personal_data_manager_observer.h"
12 #include "chrome/browser/sync/glue/new_non_frontend_data_type_controller.h"
13 #include "content/common/notification_observer.h"
14 #include "content/common/notification_registrar.h"
15
16 class NotificationDetails;
17 class NotificationSource;
18 class PersonalDataManager;
19 class WebDataService;
20 11
21 namespace browser_sync { 12 namespace browser_sync {
22 13
23 class AutofillProfileDataTypeController 14 class AutofillProfileDataTypeController : public AutofillDataTypeController {
24 : public NewNonFrontendDataTypeController,
25 public NotificationObserver,
26 public PersonalDataManagerObserver {
27 public: 15 public:
28 AutofillProfileDataTypeController( 16 AutofillProfileDataTypeController(
29 ProfileSyncFactory* profile_sync_factory, 17 ProfileSyncFactory* profile_sync_factory,
30 Profile* profile); 18 Profile* profile);
31 virtual ~AutofillProfileDataTypeController(); 19 virtual ~AutofillProfileDataTypeController();
32 20
33 // NewNonFrontendDataTypeController implementation. 21 virtual syncable::ModelType type() const;
34 virtual syncable::ModelType type() const OVERRIDE;
35 virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE;
36
37 // NotificationObserver implementation.
38 virtual void Observe(int type,
39 const NotificationSource& source,
40 const NotificationDetails& details) OVERRIDE;
41
42 // PersonalDataManagerObserver implementation:
43 virtual void OnPersonalDataChanged() OVERRIDE;
44 22
45 protected: 23 protected:
46 // NewNonFrontendDataTypeController implementation. 24 virtual void CreateSyncComponents();
47 virtual bool StartModels() OVERRIDE;
48 virtual bool StartAssociationAsync() OVERRIDE;
49 virtual base::WeakPtr<SyncableService> GetWeakPtrToSyncableService()
50 const OVERRIDE;
51 virtual void StopModels() OVERRIDE;
52 virtual void StopLocalServiceAsync() OVERRIDE;
53 virtual void RecordUnrecoverableError( 25 virtual void RecordUnrecoverableError(
54 const tracked_objects::Location& from_here, 26 const tracked_objects::Location& from_here,
55 const std::string& message) OVERRIDE; 27 const std::string& message);
56 virtual void RecordAssociationTime(base::TimeDelta time) OVERRIDE; 28 virtual void RecordAssociationTime(base::TimeDelta time);
57 virtual void RecordStartFailure(StartResult result) OVERRIDE; 29 virtual void RecordStartFailure(StartResult result);
58
59 void DoStartAssociationAsync();
60
61 private:
62 PersonalDataManager* personal_data_;
63 scoped_refptr<WebDataService> web_data_service_;
64 NotificationRegistrar notification_registrar_;
65
66 DISALLOW_COPY_AND_ASSIGN(AutofillProfileDataTypeController);
67 }; 30 };
68 31
69 } // namespace browser_sync 32 } // namespace browser_sync
70 33
71 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_ 34 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698