| 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 CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/location.h" | 16 #include "base/location.h" |
| 17 #include "base/memory/memory_pressure_listener.h" | 17 #include "base/memory/memory_pressure_listener.h" |
| 18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 22 #include "base/threading/thread_checker.h" |
| 22 #include "base/time/time.h" | 23 #include "base/time/time.h" |
| 23 #include "base/timer/timer.h" | 24 #include "base/timer/timer.h" |
| 24 #include "chrome/browser/sync/glue/sync_backend_host.h" | 25 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 25 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" | 26 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" |
| 26 #include "components/keyed_service/core/keyed_service.h" | 27 #include "components/keyed_service/core/keyed_service.h" |
| 27 #include "components/signin/core/browser/signin_manager_base.h" | 28 #include "components/signin/core/browser/signin_manager_base.h" |
| 28 #include "components/sync_driver/backup_rollback_controller.h" | 29 #include "components/sync_driver/backup_rollback_controller.h" |
| 29 #include "components/sync_driver/data_type_controller.h" | 30 #include "components/sync_driver/data_type_controller.h" |
| 30 #include "components/sync_driver/data_type_manager.h" | 31 #include "components/sync_driver/data_type_manager.h" |
| 31 #include "components/sync_driver/data_type_manager_observer.h" | 32 #include "components/sync_driver/data_type_manager_observer.h" |
| (...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 bool catch_up_configure_in_progress_; | 978 bool catch_up_configure_in_progress_; |
| 978 | 979 |
| 979 // Whether the major version has changed since the last time Chrome ran, | 980 // Whether the major version has changed since the last time Chrome ran, |
| 980 // and therefore a passphrase required state should result in prompting | 981 // and therefore a passphrase required state should result in prompting |
| 981 // the user. This logic is only enabled on platforms that consume the | 982 // the user. This logic is only enabled on platforms that consume the |
| 982 // IsPassphrasePrompted sync preference. | 983 // IsPassphrasePrompted sync preference. |
| 983 bool passphrase_prompt_triggered_by_version_; | 984 bool passphrase_prompt_triggered_by_version_; |
| 984 | 985 |
| 985 content::NotificationRegistrar registrar_; | 986 content::NotificationRegistrar registrar_; |
| 986 | 987 |
| 988 // Used to ensure that certain operations are performed on the thread that |
| 989 // this object was created on. |
| 990 base::ThreadChecker thread_checker_; |
| 991 |
| 987 base::WeakPtrFactory<ProfileSyncService> weak_factory_; | 992 base::WeakPtrFactory<ProfileSyncService> weak_factory_; |
| 988 | 993 |
| 989 // We don't use |weak_factory_| for the StartupController because the weak | 994 // We don't use |weak_factory_| for the StartupController because the weak |
| 990 // ptrs should be bound to the lifetime of ProfileSyncService and not to the | 995 // ptrs should be bound to the lifetime of ProfileSyncService and not to the |
| 991 // [Initialize -> sync disabled/shutdown] lifetime. We don't pass | 996 // [Initialize -> sync disabled/shutdown] lifetime. We don't pass |
| 992 // StartupController an Unretained reference to future-proof against | 997 // StartupController an Unretained reference to future-proof against |
| 993 // the controller impl changing to post tasks. Therefore, we have a separate | 998 // the controller impl changing to post tasks. Therefore, we have a separate |
| 994 // factory. | 999 // factory. |
| 995 base::WeakPtrFactory<ProfileSyncService> startup_controller_weak_factory_; | 1000 base::WeakPtrFactory<ProfileSyncService> startup_controller_weak_factory_; |
| 996 | 1001 |
| 997 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 1002 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 998 }; | 1003 }; |
| 999 | 1004 |
| 1000 bool ShouldShowActionOnUI( | 1005 bool ShouldShowActionOnUI( |
| 1001 const syncer::SyncProtocolError& error); | 1006 const syncer::SyncProtocolError& error); |
| 1002 | 1007 |
| 1003 | 1008 |
| 1004 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 1009 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |