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 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_DATA_TYPE_CONTROLLER_H
__ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_DATA_TYPE_CONTROLLER_H
__ |
6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_DATA_TYPE_CONTROLLER_H
__ | 6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_DATA_TYPE_CONTROLLER_H
__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "components/sync/driver/non_ui_data_type_controller.h" | 11 #include "components/sync/driver/non_ui_data_type_controller.h" |
12 #include "components/sync/driver/sync_service_observer.h" | 12 #include "components/sync/driver/sync_service_observer.h" |
13 | 13 |
14 namespace password_manager { | 14 namespace password_manager { |
15 class PasswordStore; | 15 class PasswordStore; |
16 } | 16 } |
17 | 17 |
18 namespace syncer { | 18 namespace sync_driver { |
19 class SyncClient; | 19 class SyncClient; |
20 } | 20 } |
21 | 21 |
22 namespace browser_sync { | 22 namespace browser_sync { |
23 | 23 |
24 // A class that manages the startup and shutdown of password sync. | 24 // A class that manages the startup and shutdown of password sync. |
25 class PasswordDataTypeController : public syncer::NonUIDataTypeController, | 25 class PasswordDataTypeController : public sync_driver::NonUIDataTypeController, |
26 public syncer::SyncServiceObserver { | 26 public sync_driver::SyncServiceObserver { |
27 public: | 27 public: |
28 // |dump_stack| is called when an unrecoverable error occurs. | 28 // |dump_stack| is called when an unrecoverable error occurs. |
29 PasswordDataTypeController( | 29 PasswordDataTypeController( |
30 const base::Closure& dump_stack, | 30 const base::Closure& dump_stack, |
31 syncer::SyncClient* sync_client, | 31 sync_driver::SyncClient* sync_client, |
32 const base::Closure& state_changed_callback, | 32 const base::Closure& state_changed_callback, |
33 const scoped_refptr<password_manager::PasswordStore>& password_store); | 33 const scoped_refptr<password_manager::PasswordStore>& password_store); |
34 ~PasswordDataTypeController() override; | 34 ~PasswordDataTypeController() override; |
35 | 35 |
36 // NonFrontendDataTypeController implementation | 36 // NonFrontendDataTypeController implementation |
37 syncer::ModelSafeGroup model_safe_group() const override; | 37 syncer::ModelSafeGroup model_safe_group() const override; |
38 | 38 |
39 protected: | 39 protected: |
40 // NonUIDataTypeController interface. | 40 // NonUIDataTypeController interface. |
41 bool PostTaskOnBackendThread(const tracked_objects::Location& from_here, | 41 bool PostTaskOnBackendThread(const tracked_objects::Location& from_here, |
42 const base::Closure& task) override; | 42 const base::Closure& task) override; |
43 bool StartModels() override; | 43 bool StartModels() override; |
44 void StopModels() override; | 44 void StopModels() override; |
45 | 45 |
46 // syncer::SyncServiceObserver: | 46 // sync_driver::SyncServiceObserver: |
47 void OnStateChanged() override; | 47 void OnStateChanged() override; |
48 | 48 |
49 private: | 49 private: |
50 syncer::SyncClient* const sync_client_; | 50 sync_driver::SyncClient* const sync_client_; |
51 const base::Closure state_changed_callback_; | 51 const base::Closure state_changed_callback_; |
52 scoped_refptr<password_manager::PasswordStore> password_store_; | 52 scoped_refptr<password_manager::PasswordStore> password_store_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(PasswordDataTypeController); | 54 DISALLOW_COPY_AND_ASSIGN(PasswordDataTypeController); |
55 }; | 55 }; |
56 | 56 |
57 } // namespace browser_sync | 57 } // namespace browser_sync |
58 | 58 |
59 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_DATA_TYPE_CONTROLLE
R_H__ | 59 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_DATA_TYPE_CONTROLLE
R_H__ |
OLD | NEW |