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 "components/browser_sync/browser/profile_sync_service.h" | 5 #include "components/browser_sync/browser/profile_sync_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1750 const PlatformSyncAllowedProvider& platform_sync_allowed_provider) { | 1750 const PlatformSyncAllowedProvider& platform_sync_allowed_provider) { |
1751 platform_sync_allowed_provider_ = platform_sync_allowed_provider; | 1751 platform_sync_allowed_provider_ = platform_sync_allowed_provider; |
1752 } | 1752 } |
1753 | 1753 |
1754 void ProfileSyncService::ConfigureDataTypeManager() { | 1754 void ProfileSyncService::ConfigureDataTypeManager() { |
1755 // Don't configure datatypes if the setup UI is still on the screen - this | 1755 // Don't configure datatypes if the setup UI is still on the screen - this |
1756 // is to help multi-screen setting UIs (like iOS) where they don't want to | 1756 // is to help multi-screen setting UIs (like iOS) where they don't want to |
1757 // start syncing data until the user is done configuring encryption options, | 1757 // start syncing data until the user is done configuring encryption options, |
1758 // etc. ReconfigureDatatypeManager() will get called again once the UI calls | 1758 // etc. ReconfigureDatatypeManager() will get called again once the UI calls |
1759 // SetSetupInProgress(false). | 1759 // SetSetupInProgress(false). |
1760 if (!CanConfigureDataTypes()) | 1760 if (!CanConfigureDataTypes()) { |
| 1761 // If we can't configure the data type manager yet, we should still notify |
| 1762 // observers. This is to support multiple setup UIs being open at once. |
| 1763 NotifyObservers(); |
1761 return; | 1764 return; |
| 1765 } |
1762 | 1766 |
1763 bool restart = false; | 1767 bool restart = false; |
1764 if (!data_type_manager_) { | 1768 if (!data_type_manager_) { |
1765 restart = true; | 1769 restart = true; |
1766 data_type_manager_.reset( | 1770 data_type_manager_.reset( |
1767 sync_client_->GetSyncApiComponentFactory()->CreateDataTypeManager( | 1771 sync_client_->GetSyncApiComponentFactory()->CreateDataTypeManager( |
1768 debug_info_listener_, &data_type_controllers_, this, backend_.get(), | 1772 debug_info_listener_, &data_type_controllers_, this, backend_.get(), |
1769 this)); | 1773 this)); |
1770 | 1774 |
1771 // We create the migrator at the same time. | 1775 // We create the migrator at the same time. |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2522 if (--outstanding_setup_in_progress_handles_ != 0) | 2526 if (--outstanding_setup_in_progress_handles_ != 0) |
2523 return; | 2527 return; |
2524 | 2528 |
2525 DCHECK(startup_controller_->IsSetupInProgress()); | 2529 DCHECK(startup_controller_->IsSetupInProgress()); |
2526 startup_controller_->SetSetupInProgress(false); | 2530 startup_controller_->SetSetupInProgress(false); |
2527 | 2531 |
2528 if (IsBackendInitialized()) | 2532 if (IsBackendInitialized()) |
2529 ReconfigureDatatypeManager(); | 2533 ReconfigureDatatypeManager(); |
2530 NotifyObservers(); | 2534 NotifyObservers(); |
2531 } | 2535 } |
OLD | NEW |