| 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 #include "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 47 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
| 48 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" | 48 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" |
| 49 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" | 49 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" |
| 50 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" | 50 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" |
| 51 #include "chrome/browser/sync/sync_type_preference_provider.h" | 51 #include "chrome/browser/sync/sync_type_preference_provider.h" |
| 52 #include "chrome/browser/ui/browser.h" | 52 #include "chrome/browser/ui/browser.h" |
| 53 #include "chrome/browser/ui/browser_list.h" | 53 #include "chrome/browser/ui/browser_list.h" |
| 54 #include "chrome/browser/ui/browser_window.h" | 54 #include "chrome/browser/ui/browser_window.h" |
| 55 #include "chrome/browser/ui/global_error/global_error_service.h" | 55 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 56 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 56 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 57 #include "chrome/common/channel_info.h" |
| 57 #include "chrome/common/chrome_switches.h" | 58 #include "chrome/common/chrome_switches.h" |
| 58 #include "chrome/common/pref_names.h" | 59 #include "chrome/common/pref_names.h" |
| 59 #include "chrome/common/sync_util.h" | |
| 60 #include "chrome/common/url_constants.h" | 60 #include "chrome/common/url_constants.h" |
| 61 #include "chrome/grit/generated_resources.h" | 61 #include "chrome/grit/generated_resources.h" |
| 62 #include "components/autofill/core/common/autofill_pref_names.h" | 62 #include "components/autofill/core/common/autofill_pref_names.h" |
| 63 #include "components/invalidation/impl/profile_invalidation_provider.h" | 63 #include "components/invalidation/impl/profile_invalidation_provider.h" |
| 64 #include "components/invalidation/public/invalidation_service.h" | 64 #include "components/invalidation/public/invalidation_service.h" |
| 65 #include "components/password_manager/core/browser/password_store.h" | 65 #include "components/password_manager/core/browser/password_store.h" |
| 66 #include "components/pref_registry/pref_registry_syncable.h" | 66 #include "components/pref_registry/pref_registry_syncable.h" |
| 67 #include "components/signin/core/browser/about_signin_internals.h" | 67 #include "components/signin/core/browser/about_signin_internals.h" |
| 68 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 68 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 69 #include "components/signin/core/browser/signin_manager.h" | 69 #include "components/signin/core/browser/signin_manager.h" |
| 70 #include "components/signin/core/browser/signin_metrics.h" | 70 #include "components/signin/core/browser/signin_metrics.h" |
| 71 #include "components/sync_driver/backend_migrator.h" | 71 #include "components/sync_driver/backend_migrator.h" |
| 72 #include "components/sync_driver/change_processor.h" | 72 #include "components/sync_driver/change_processor.h" |
| 73 #include "components/sync_driver/data_type_controller.h" | 73 #include "components/sync_driver/data_type_controller.h" |
| 74 #include "components/sync_driver/device_info.h" | 74 #include "components/sync_driver/device_info.h" |
| 75 #include "components/sync_driver/pref_names.h" | 75 #include "components/sync_driver/pref_names.h" |
| 76 #include "components/sync_driver/sync_error_controller.h" | 76 #include "components/sync_driver/sync_error_controller.h" |
| 77 #include "components/sync_driver/sync_stopped_reporter.h" | 77 #include "components/sync_driver/sync_stopped_reporter.h" |
| 78 #include "components/sync_driver/sync_util.h" |
| 78 #include "components/sync_driver/system_encryptor.h" | 79 #include "components/sync_driver/system_encryptor.h" |
| 79 #include "components/sync_driver/user_selectable_sync_type.h" | 80 #include "components/sync_driver/user_selectable_sync_type.h" |
| 80 #include "components/version_info/version_info_values.h" | 81 #include "components/version_info/version_info_values.h" |
| 81 #include "content/public/browser/browser_thread.h" | 82 #include "content/public/browser/browser_thread.h" |
| 82 #include "content/public/browser/notification_details.h" | 83 #include "content/public/browser/notification_details.h" |
| 83 #include "content/public/browser/notification_service.h" | 84 #include "content/public/browser/notification_service.h" |
| 84 #include "content/public/browser/notification_source.h" | 85 #include "content/public/browser/notification_source.h" |
| 85 #include "net/cookies/cookie_monster.h" | 86 #include "net/cookies/cookie_monster.h" |
| 86 #include "net/url_request/url_request_context_getter.h" | 87 #include "net/url_request/url_request_context_getter.h" |
| 87 #include "sync/api/sync_error.h" | 88 #include "sync/api/sync_error.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 scoped_ptr<SupervisedUserSigninManagerWrapper> signin_wrapper, | 210 scoped_ptr<SupervisedUserSigninManagerWrapper> signin_wrapper, |
| 210 ProfileOAuth2TokenService* oauth2_token_service, | 211 ProfileOAuth2TokenService* oauth2_token_service, |
| 211 ProfileSyncServiceStartBehavior start_behavior) | 212 ProfileSyncServiceStartBehavior start_behavior) |
| 212 : OAuth2TokenService::Consumer("sync"), | 213 : OAuth2TokenService::Consumer("sync"), |
| 213 last_auth_error_(AuthError::AuthErrorNone()), | 214 last_auth_error_(AuthError::AuthErrorNone()), |
| 214 passphrase_required_reason_(syncer::REASON_PASSPHRASE_NOT_REQUIRED), | 215 passphrase_required_reason_(syncer::REASON_PASSPHRASE_NOT_REQUIRED), |
| 215 factory_(factory.Pass()), | 216 factory_(factory.Pass()), |
| 216 profile_(profile), | 217 profile_(profile), |
| 217 sync_prefs_(profile_->GetPrefs()), | 218 sync_prefs_(profile_->GetPrefs()), |
| 218 sync_service_url_( | 219 sync_service_url_( |
| 219 GetSyncServiceURL(*base::CommandLine::ForCurrentProcess())), | 220 GetSyncServiceURL(*base::CommandLine::ForCurrentProcess(), |
| 221 chrome::GetChannel())), |
| 220 is_first_time_sync_configure_(false), | 222 is_first_time_sync_configure_(false), |
| 221 backend_initialized_(false), | 223 backend_initialized_(false), |
| 222 sync_disabled_by_admin_(false), | 224 sync_disabled_by_admin_(false), |
| 223 is_auth_in_progress_(false), | 225 is_auth_in_progress_(false), |
| 224 signin_(signin_wrapper.Pass()), | 226 signin_(signin_wrapper.Pass()), |
| 225 unrecoverable_error_reason_(ERROR_REASON_UNSET), | 227 unrecoverable_error_reason_(ERROR_REASON_UNSET), |
| 226 expect_sync_configuration_aborted_(false), | 228 expect_sync_configuration_aborted_(false), |
| 227 encrypted_types_(syncer::SyncEncryptionHandler::SensitiveTypes()), | 229 encrypted_types_(syncer::SyncEncryptionHandler::SensitiveTypes()), |
| 228 encrypt_everything_allowed_(true), | 230 encrypt_everything_allowed_(true), |
| 229 encrypt_everything_(false), | 231 encrypt_everything_(false), |
| (...skipping 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2743 } else { | 2745 } else { |
| 2744 UMA_HISTOGRAM_COUNTS("Sync.MemoryPressureWarningBeforeCleanShutdown", | 2746 UMA_HISTOGRAM_COUNTS("Sync.MemoryPressureWarningBeforeCleanShutdown", |
| 2745 warning_received); | 2747 warning_received); |
| 2746 } | 2748 } |
| 2747 } | 2749 } |
| 2748 sync_prefs_.SetMemoryPressureWarningCount(0); | 2750 sync_prefs_.SetMemoryPressureWarningCount(0); |
| 2749 // Will set to true during a clean shutdown, so crash or something else will | 2751 // Will set to true during a clean shutdown, so crash or something else will |
| 2750 // remain this as false. | 2752 // remain this as false. |
| 2751 sync_prefs_.SetCleanShutdown(false); | 2753 sync_prefs_.SetCleanShutdown(false); |
| 2752 } | 2754 } |
| OLD | NEW |