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, | |
30 }; | 29 }; |
31 | 30 |
32 // Comparator used when sorting data type controllers. | 31 // Comparator used when sorting data type controllers. |
33 class SortComparator : public std::binary_function<DataTypeController*, | 32 class SortComparator : public std::binary_function<DataTypeController*, |
34 DataTypeController*, | 33 DataTypeController*, |
35 bool> { | 34 bool> { |
36 public: | 35 public: |
37 explicit SortComparator(std::map<syncable::ModelType, int>* order) | 36 explicit SortComparator(std::map<syncable::ModelType, int>* order) |
38 : order_(order) { } | 37 : order_(order) { } |
39 | 38 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 432 |
434 void DataTypeManagerImpl::PauseSyncer() { | 433 void DataTypeManagerImpl::PauseSyncer() { |
435 AddObserver(NotificationType::SYNC_PAUSED); | 434 AddObserver(NotificationType::SYNC_PAUSED); |
436 if (!backend_->RequestPause()) { | 435 if (!backend_->RequestPause()) { |
437 RemoveObserver(NotificationType::SYNC_PAUSED); | 436 RemoveObserver(NotificationType::SYNC_PAUSED); |
438 FinishStopAndNotify(UNRECOVERABLE_ERROR); | 437 FinishStopAndNotify(UNRECOVERABLE_ERROR); |
439 } | 438 } |
440 } | 439 } |
441 | 440 |
442 } // namespace browser_sync | 441 } // namespace browser_sync |
OLD | NEW |