| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <functional> | 6 #include <functional> |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "chrome/browser/chrome_thread.h" | 10 #include "chrome/browser/chrome_thread.h" |
| 11 #include "chrome/browser/sync/glue/data_type_controller.h" | 11 #include "chrome/browser/sync/glue/data_type_controller.h" |
| 12 #include "chrome/browser/sync/glue/data_type_manager_impl.h" | 12 #include "chrome/browser/sync/glue/data_type_manager_impl.h" |
| 13 #include "chrome/browser/sync/glue/sync_backend_host.h" | 13 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 14 #include "chrome/common/notification_details.h" | 14 #include "chrome/common/notification_details.h" |
| 15 #include "chrome/common/notification_service.h" | 15 #include "chrome/common/notification_service.h" |
| 16 #include "chrome/common/notification_source.h" | 16 #include "chrome/common/notification_source.h" |
| 17 | 17 |
| 18 namespace browser_sync { | 18 namespace browser_sync { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 static const syncable::ModelType kStartOrder[] = { | 22 static const syncable::ModelType kStartOrder[] = { |
| 23 syncable::BOOKMARKS, | 23 syncable::BOOKMARKS, |
| 24 syncable::PREFERENCES, | 24 syncable::PREFERENCES, |
| 25 syncable::AUTOFILL, | 25 syncable::AUTOFILL, |
| 26 syncable::THEMES, | 26 syncable::THEMES, |
| 27 syncable::TYPED_URLS, | 27 syncable::TYPED_URLS, |
| 28 syncable::PASSWORDS, | 28 syncable::PASSWORDS, |
| 29 syncable::SESSIONS, |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 // Comparator used when sorting data type controllers. | 32 // Comparator used when sorting data type controllers. |
| 32 class SortComparator : public std::binary_function<DataTypeController*, | 33 class SortComparator : public std::binary_function<DataTypeController*, |
| 33 DataTypeController*, | 34 DataTypeController*, |
| 34 bool> { | 35 bool> { |
| 35 public: | 36 public: |
| 36 explicit SortComparator(std::map<syncable::ModelType, int>* order) | 37 explicit SortComparator(std::map<syncable::ModelType, int>* order) |
| 37 : order_(order) { } | 38 : order_(order) { } |
| 38 | 39 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 | 433 |
| 433 void DataTypeManagerImpl::PauseSyncer() { | 434 void DataTypeManagerImpl::PauseSyncer() { |
| 434 AddObserver(NotificationType::SYNC_PAUSED); | 435 AddObserver(NotificationType::SYNC_PAUSED); |
| 435 if (!backend_->RequestPause()) { | 436 if (!backend_->RequestPause()) { |
| 436 RemoveObserver(NotificationType::SYNC_PAUSED); | 437 RemoveObserver(NotificationType::SYNC_PAUSED); |
| 437 FinishStopAndNotify(UNRECOVERABLE_ERROR); | 438 FinishStopAndNotify(UNRECOVERABLE_ERROR); |
| 438 } | 439 } |
| 439 } | 440 } |
| 440 | 441 |
| 441 } // namespace browser_sync | 442 } // namespace browser_sync |
| OLD | NEW |