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/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2148 if (awaiting_types_.Empty()) { | 2148 if (awaiting_types_.Empty()) { |
2149 callback_.Run(result_accumulator_.Pass()); | 2149 callback_.Run(result_accumulator_.Pass()); |
2150 callback_.Reset(); | 2150 callback_.Reset(); |
2151 } | 2151 } |
2152 } | 2152 } |
2153 | 2153 |
2154 } // namespace | 2154 } // namespace |
2155 | 2155 |
2156 void ProfileSyncService::GetAllNodes( | 2156 void ProfileSyncService::GetAllNodes( |
2157 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) { | 2157 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) { |
2158 // TODO(rlarocque): Should be GetRegisteredDirectoryTypes. | 2158 ModelTypeSet directory_types = GetRegisteredDirectoryDataTypes(); |
2159 const ModelTypeSet directory_types = GetRegisteredDataTypes(); | 2159 directory_types.PutAll(syncer::ControlTypes()); |
2160 scoped_refptr<GetAllNodesRequestHelper> helper = | 2160 scoped_refptr<GetAllNodesRequestHelper> helper = |
2161 new GetAllNodesRequestHelper(directory_types, callback); | 2161 new GetAllNodesRequestHelper(directory_types, callback); |
2162 | 2162 |
2163 if (!backend_initialized_) { | 2163 if (!backend_initialized_) { |
2164 // If there's no backend available to fulfill the request, handle it here. | 2164 // If there's no backend available to fulfill the request, handle it here. |
2165 ScopedVector<base::ListValue> empty_results; | 2165 ScopedVector<base::ListValue> empty_results; |
2166 std::vector<ModelType> type_vector; | 2166 std::vector<ModelType> type_vector; |
2167 for (ModelTypeSet::Iterator it = directory_types.First(); | 2167 for (ModelTypeSet::Iterator it = directory_types.First(); |
2168 it.Good(); it.Inc()) { | 2168 it.Good(); it.Inc()) { |
2169 type_vector.push_back(it.Get()); | 2169 type_vector.push_back(it.Get()); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2313 status.last_get_token_error = last_get_token_error_; | 2313 status.last_get_token_error = last_get_token_error_; |
2314 if (request_access_token_retry_timer_.IsRunning()) | 2314 if (request_access_token_retry_timer_.IsRunning()) |
2315 status.next_token_request_time = next_token_request_time_; | 2315 status.next_token_request_time = next_token_request_time_; |
2316 return status; | 2316 return status; |
2317 } | 2317 } |
2318 | 2318 |
2319 void ProfileSyncService::OverrideNetworkResourcesForTest( | 2319 void ProfileSyncService::OverrideNetworkResourcesForTest( |
2320 scoped_ptr<syncer::NetworkResources> network_resources) { | 2320 scoped_ptr<syncer::NetworkResources> network_resources) { |
2321 network_resources_ = network_resources.Pass(); | 2321 network_resources_ = network_resources.Pass(); |
2322 } | 2322 } |
OLD | NEW |