Chromium Code Reviews| 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/engine/syncer.h" | 5 #include "chrome/browser/sync/engine/syncer.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 #include "build/build_config.h" | |
| 12 #include "chrome/browser/sync/engine/apply_updates_command.h" | 13 #include "chrome/browser/sync/engine/apply_updates_command.h" |
| 13 #include "chrome/browser/sync/engine/build_commit_command.h" | 14 #include "chrome/browser/sync/engine/build_commit_command.h" |
| 14 #include "chrome/browser/sync/engine/cleanup_disabled_types_command.h" | 15 #include "chrome/browser/sync/engine/cleanup_disabled_types_command.h" |
| 15 #include "chrome/browser/sync/engine/clear_data_command.h" | 16 #include "chrome/browser/sync/engine/clear_data_command.h" |
| 16 #include "chrome/browser/sync/engine/conflict_resolver.h" | 17 #include "chrome/browser/sync/engine/conflict_resolver.h" |
| 17 #include "chrome/browser/sync/engine/download_updates_command.h" | 18 #include "chrome/browser/sync/engine/download_updates_command.h" |
| 18 #include "chrome/browser/sync/engine/get_commit_ids_command.h" | 19 #include "chrome/browser/sync/engine/get_commit_ids_command.h" |
| 19 #include "chrome/browser/sync/engine/net/server_connection_manager.h" | 20 #include "chrome/browser/sync/engine/net/server_connection_manager.h" |
| 20 #include "chrome/browser/sync/engine/post_commit_message_command.h" | 21 #include "chrome/browser/sync/engine/post_commit_message_command.h" |
| 21 #include "chrome/browser/sync/engine/process_commit_response_command.h" | 22 #include "chrome/browser/sync/engine/process_commit_response_command.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 | 135 |
| 135 next_step = CLEANUP_DISABLED_TYPES; | 136 next_step = CLEANUP_DISABLED_TYPES; |
| 136 break; | 137 break; |
| 137 case CLEANUP_DISABLED_TYPES: { | 138 case CLEANUP_DISABLED_TYPES: { |
| 138 CleanupDisabledTypesCommand cleanup; | 139 CleanupDisabledTypesCommand cleanup; |
| 139 cleanup.Execute(session); | 140 cleanup.Execute(session); |
| 140 next_step = DOWNLOAD_UPDATES; | 141 next_step = DOWNLOAD_UPDATES; |
| 141 break; | 142 break; |
| 142 } | 143 } |
| 143 case DOWNLOAD_UPDATES: { | 144 case DOWNLOAD_UPDATES: { |
| 144 DownloadUpdatesCommand download_updates; | 145 // TODO(akalin): We may want to propagate this switch up |
| 146 // eventually. | |
| 147 #if defined(OS_ANDROID) | |
| 148 const bool kIncludeSyncableBookmarks = true; | |
|
Yaron
2012/02/27 22:17:01
You could start renaming this to kCreateMobileBook
akalin
2012/02/27 22:29:44
Done.
| |
| 149 #else | |
| 150 const bool kIncludeSyncableBookmarks = false; | |
| 151 #endif | |
| 152 DownloadUpdatesCommand download_updates(kIncludeSyncableBookmarks); | |
| 145 session->mutable_status_controller()->set_last_download_updates_result( | 153 session->mutable_status_controller()->set_last_download_updates_result( |
| 146 download_updates.Execute(session)); | 154 download_updates.Execute(session)); |
| 147 next_step = PROCESS_CLIENT_COMMAND; | 155 next_step = PROCESS_CLIENT_COMMAND; |
| 148 break; | 156 break; |
| 149 } | 157 } |
| 150 case PROCESS_CLIENT_COMMAND: { | 158 case PROCESS_CLIENT_COMMAND: { |
| 151 ProcessClientCommand(session); | 159 ProcessClientCommand(session); |
| 152 next_step = VERIFY_UPDATES; | 160 next_step = VERIFY_UPDATES; |
| 153 break; | 161 break; |
| 154 } | 162 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 entry->Put(SERVER_CTIME, Time()); | 351 entry->Put(SERVER_CTIME, Time()); |
| 344 entry->Put(SERVER_VERSION, 0); | 352 entry->Put(SERVER_VERSION, 0); |
| 345 entry->Put(SERVER_IS_DIR, false); | 353 entry->Put(SERVER_IS_DIR, false); |
| 346 entry->Put(SERVER_IS_DEL, false); | 354 entry->Put(SERVER_IS_DEL, false); |
| 347 entry->Put(IS_UNAPPLIED_UPDATE, false); | 355 entry->Put(IS_UNAPPLIED_UPDATE, false); |
| 348 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 356 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); |
| 349 entry->Put(SERVER_POSITION_IN_PARENT, 0); | 357 entry->Put(SERVER_POSITION_IN_PARENT, 0); |
| 350 } | 358 } |
| 351 | 359 |
| 352 } // namespace browser_sync | 360 } // namespace browser_sync |
| OLD | NEW |