| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/download_updates_command.h" | 5 #include "chrome/browser/sync/engine/download_updates_command.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/sync/engine/syncer.h" | 9 #include "chrome/browser/sync/engine/syncer.h" |
| 10 #include "chrome/browser/sync/engine/syncer_proto_util.h" | 10 #include "chrome/browser/sync/engine/syncer_proto_util.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // Set the requested_types protobuf field so that we fetch all enabled types. | 61 // Set the requested_types protobuf field so that we fetch all enabled types. |
| 62 SetRequestedTypes(target.data_types, get_updates->mutable_requested_types()); | 62 SetRequestedTypes(target.data_types, get_updates->mutable_requested_types()); |
| 63 | 63 |
| 64 // We want folders for our associated types, always. If we were to set | 64 // We want folders for our associated types, always. If we were to set |
| 65 // this to false, the server would send just the non-container items | 65 // this to false, the server would send just the non-container items |
| 66 // (e.g. Bookmark URLs but not their containing folders). | 66 // (e.g. Bookmark URLs but not their containing folders). |
| 67 get_updates->set_fetch_folders(true); | 67 get_updates->set_fetch_folders(true); |
| 68 | 68 |
| 69 // Set GetUpdatesMessage.GetUpdatesCallerInfo information. | 69 // Set GetUpdatesMessage.GetUpdatesCallerInfo information. |
| 70 get_updates->mutable_caller_info()->set_source( | 70 get_updates->mutable_caller_info()->set_source( |
| 71 session->TestAndSetSource().first); | 71 session->TestAndSetSource().updates_source()); |
| 72 get_updates->mutable_caller_info()->set_notifications_enabled( | 72 get_updates->mutable_caller_info()->set_notifications_enabled( |
| 73 session->context()->notifications_enabled()); | 73 session->context()->notifications_enabled()); |
| 74 | 74 |
| 75 SyncerProtoUtil::AddRequestBirthday(dir, &client_to_server_message); | 75 SyncerProtoUtil::AddRequestBirthday(dir, &client_to_server_message); |
| 76 | 76 |
| 77 bool ok = SyncerProtoUtil::PostClientToServerMessage( | 77 bool ok = SyncerProtoUtil::PostClientToServerMessage( |
| 78 client_to_server_message, | 78 client_to_server_message, |
| 79 &update_response, | 79 &update_response, |
| 80 session); | 80 session); |
| 81 | 81 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 111 if (target_datatypes[i]) { | 111 if (target_datatypes[i]) { |
| 112 requested_type_count++; | 112 requested_type_count++; |
| 113 syncable::AddDefaultExtensionValue(syncable::ModelTypeFromInt(i), | 113 syncable::AddDefaultExtensionValue(syncable::ModelTypeFromInt(i), |
| 114 filter_protobuf); | 114 filter_protobuf); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 DCHECK_LT(0, requested_type_count) << "Doing GetUpdates with empty filter."; | 117 DCHECK_LT(0, requested_type_count) << "Doing GetUpdates with empty filter."; |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace browser_sync | 120 } // namespace browser_sync |
| OLD | NEW |