| 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 "chrome/browser/sync/profile_sync_service_harness.h" | 5 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 for (int i = syncable::FIRST_REAL_MODEL_TYPE; | 123 for (int i = syncable::FIRST_REAL_MODEL_TYPE; |
| 124 i < syncable::MODEL_TYPE_COUNT; ++i) { | 124 i < syncable::MODEL_TYPE_COUNT; ++i) { |
| 125 synced_datatypes.insert(syncable::ModelTypeFromInt(i)); | 125 synced_datatypes.insert(syncable::ModelTypeFromInt(i)); |
| 126 } | 126 } |
| 127 return SetupSync(synced_datatypes); | 127 return SetupSync(synced_datatypes); |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool ProfileSyncServiceHarness::SetupSync( | 130 bool ProfileSyncServiceHarness::SetupSync( |
| 131 const syncable::ModelTypeSet& synced_datatypes) { | 131 const syncable::ModelTypeSet& synced_datatypes) { |
| 132 // Initialize the sync client's profile sync service object. | 132 // Initialize the sync client's profile sync service object. |
| 133 service_ = profile_->GetProfileSyncService(); | 133 service_ = profile_->GetProfileSyncService(""); |
| 134 if (service_ == NULL) { | 134 if (service_ == NULL) { |
| 135 LOG(ERROR) << "SetupSync(): service_ is null."; | 135 LOG(ERROR) << "SetupSync(): service_ is null."; |
| 136 return false; | 136 return false; |
| 137 } | 137 } |
| 138 | 138 |
| 139 // Subscribe sync client to notifications from the profile sync service. | 139 // Subscribe sync client to notifications from the profile sync service. |
| 140 if (!service_->HasObserver(this)) | 140 if (!service_->HasObserver(this)) |
| 141 service_->AddObserver(this); | 141 service_->AddObserver(this); |
| 142 | 142 |
| 143 // Authenticate sync client using GAIA credentials. | 143 // Authenticate sync client using GAIA credentials. |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 << ", service_is_pushing_changes: " << ServiceIsPushingChanges(); | 590 << ", service_is_pushing_changes: " << ServiceIsPushingChanges(); |
| 591 } else { | 591 } else { |
| 592 VLOG(1) << "Client " << id_ << ": " << message | 592 VLOG(1) << "Client " << id_ << ": " << message |
| 593 << ": Sync session snapshot not available."; | 593 << ": Sync session snapshot not available."; |
| 594 } | 594 } |
| 595 } else { | 595 } else { |
| 596 VLOG(1) << "Client " << id_ << ": " << message | 596 VLOG(1) << "Client " << id_ << ": " << message |
| 597 << ": Sync service not available."; | 597 << ": Sync service not available."; |
| 598 } | 598 } |
| 599 } | 599 } |
| OLD | NEW |