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/backend_migrator.h" | 5 #include "chrome/browser/sync/backend_migrator.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/tracked_objects.h" | 9 #include "base/tracked_objects.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 DCHECK_GT(state_, WAITING_TO_START); | 68 DCHECK_GT(state_, WAITING_TO_START); |
69 // If we're already migrating, interrupt the current migration. | 69 // If we're already migrating, interrupt the current migration. |
70 RestartMigration(); | 70 RestartMigration(); |
71 } | 71 } |
72 | 72 |
73 void BackendMigrator::AddMigrationObserver(MigrationObserver* observer) { | 73 void BackendMigrator::AddMigrationObserver(MigrationObserver* observer) { |
74 migration_observers_.AddObserver(observer); | 74 migration_observers_.AddObserver(observer); |
75 } | 75 } |
76 | 76 |
77 bool BackendMigrator::HasMigrationObserver( | 77 bool BackendMigrator::HasMigrationObserver( |
78 MigrationObserver* observer) const { | 78 const MigrationObserver* observer) const { |
79 return migration_observers_.HasObserver(observer); | 79 return migration_observers_.HasObserver(observer); |
80 } | 80 } |
81 | 81 |
82 void BackendMigrator::RemoveMigrationObserver(MigrationObserver* observer) { | 82 void BackendMigrator::RemoveMigrationObserver(MigrationObserver* observer) { |
83 migration_observers_.RemoveObserver(observer); | 83 migration_observers_.RemoveObserver(observer); |
84 } | 84 } |
85 | 85 |
86 void BackendMigrator::ChangeState(State new_state) { | 86 void BackendMigrator::ChangeState(State new_state) { |
87 state_ = new_state; | 87 state_ = new_state; |
88 FOR_EACH_OBSERVER(MigrationObserver, migration_observers_, | 88 FOR_EACH_OBSERVER(MigrationObserver, migration_observers_, |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 syncer::ModelTypeSet BackendMigrator::GetPendingMigrationTypesForTest() const { | 217 syncer::ModelTypeSet BackendMigrator::GetPendingMigrationTypesForTest() const { |
218 return to_migrate_; | 218 return to_migrate_; |
219 } | 219 } |
220 | 220 |
221 #undef SDVLOG | 221 #undef SDVLOG |
222 | 222 |
223 #undef SLOG | 223 #undef SLOG |
224 | 224 |
225 }; // namespace browser_sync | 225 }; // namespace browser_sync |
OLD | NEW |