OLD | NEW |
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 #include "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chrome/browser/sync/glue/change_processor.h" | 33 #include "chrome/browser/sync/glue/change_processor.h" |
34 #include "chrome/browser/sync/glue/data_type_controller.h" | 34 #include "chrome/browser/sync/glue/data_type_controller.h" |
35 #include "chrome/browser/sync/glue/data_type_manager.h" | 35 #include "chrome/browser/sync/glue/data_type_manager.h" |
36 #include "chrome/browser/sync/glue/session_data_type_controller.h" | 36 #include "chrome/browser/sync/glue/session_data_type_controller.h" |
37 #include "chrome/browser/sync/glue/session_model_associator.h" | 37 #include "chrome/browser/sync/glue/session_model_associator.h" |
38 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 38 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
39 #include "chrome/browser/sync/internal_api/configure_reason.h" | 39 #include "chrome/browser/sync/internal_api/configure_reason.h" |
40 #include "chrome/browser/sync/internal_api/sync_manager.h" | 40 #include "chrome/browser/sync/internal_api/sync_manager.h" |
41 #include "chrome/browser/sync/js/js_arg_list.h" | 41 #include "chrome/browser/sync/js/js_arg_list.h" |
42 #include "chrome/browser/sync/js/js_event_details.h" | 42 #include "chrome/browser/sync/js/js_event_details.h" |
43 #include "chrome/browser/sync/profile_sync_factory.h" | 43 #include "chrome/browser/sync/profile_sync_components_factory.h" |
44 #include "chrome/browser/sync/signin_manager.h" | 44 #include "chrome/browser/sync/signin_manager.h" |
45 #include "chrome/browser/sync/sync_global_error.h" | 45 #include "chrome/browser/sync/sync_global_error.h" |
46 #include "chrome/browser/sync/util/cryptographer.h" | 46 #include "chrome/browser/sync/util/cryptographer.h" |
47 #include "chrome/browser/sync/util/oauth.h" | 47 #include "chrome/browser/sync/util/oauth.h" |
48 #include "chrome/browser/ui/browser.h" | 48 #include "chrome/browser/ui/browser.h" |
49 #include "chrome/browser/ui/browser_list.h" | 49 #include "chrome/browser/ui/browser_list.h" |
50 #include "chrome/browser/ui/browser_window.h" | 50 #include "chrome/browser/ui/browser_window.h" |
51 #include "chrome/browser/ui/global_error_service.h" | 51 #include "chrome/browser/ui/global_error_service.h" |
52 #include "chrome/browser/ui/global_error_service_factory.h" | 52 #include "chrome/browser/ui/global_error_service_factory.h" |
53 #include "chrome/common/chrome_notification_types.h" | 53 #include "chrome/common/chrome_notification_types.h" |
(...skipping 30 matching lines...) Expand all Loading... |
84 | 84 |
85 static const int kSyncClearDataTimeoutInSeconds = 60; // 1 minute. | 85 static const int kSyncClearDataTimeoutInSeconds = 60; // 1 minute. |
86 | 86 |
87 | 87 |
88 bool ShouldShowActionOnUI( | 88 bool ShouldShowActionOnUI( |
89 const browser_sync::SyncProtocolError& error) { | 89 const browser_sync::SyncProtocolError& error) { |
90 return (error.action != browser_sync::UNKNOWN_ACTION && | 90 return (error.action != browser_sync::UNKNOWN_ACTION && |
91 error.action != browser_sync::DISABLE_SYNC_ON_CLIENT); | 91 error.action != browser_sync::DISABLE_SYNC_ON_CLIENT); |
92 } | 92 } |
93 | 93 |
94 ProfileSyncService::ProfileSyncService(ProfileSyncFactory* factory, | 94 ProfileSyncService::ProfileSyncService(ProfileSyncComponentsFactory* factory, |
95 Profile* profile, | 95 Profile* profile, |
96 SigninManager* signin_manager, | 96 SigninManager* signin_manager, |
97 const std::string& cros_user) | 97 const std::string& cros_user) |
98 : last_auth_error_(AuthError::None()), | 98 : last_auth_error_(AuthError::None()), |
99 passphrase_required_reason_(sync_api::REASON_PASSPHRASE_NOT_REQUIRED), | 99 passphrase_required_reason_(sync_api::REASON_PASSPHRASE_NOT_REQUIRED), |
100 factory_(factory), | 100 factory_(factory), |
101 profile_(profile), | 101 profile_(profile), |
102 // |profile| may be NULL in unit tests. | 102 // |profile| may be NULL in unit tests. |
103 sync_prefs_(profile_ ? profile_->GetPrefs() : NULL), | 103 sync_prefs_(profile_ ? profile_->GetPrefs() : NULL), |
104 cros_user_(cros_user), | 104 cros_user_(cros_user), |
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 << "Unrecoverable error."; | 1549 << "Unrecoverable error."; |
1550 } else { | 1550 } else { |
1551 VLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " | 1551 VLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " |
1552 << "initialized"; | 1552 << "initialized"; |
1553 } | 1553 } |
1554 } | 1554 } |
1555 | 1555 |
1556 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { | 1556 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { |
1557 return failed_datatypes_handler_; | 1557 return failed_datatypes_handler_; |
1558 } | 1558 } |
OLD | NEW |