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/google_apis/gdata_wapi_service.h" | 5 #include "chrome/browser/google_apis/gdata_wapi_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 184 url_request_context_getter_, | 184 url_request_context_getter_, |
| 185 url_generator_, | 185 url_generator_, |
| 186 url, | 186 url, |
| 187 static_cast<int>(start_changestamp), | 187 static_cast<int>(start_changestamp), |
| 188 search_query, | 188 search_query, |
| 189 shared_with_me, | 189 shared_with_me, |
| 190 directory_resource_id, | 190 directory_resource_id, |
| 191 callback)); | 191 callback)); |
| 192 } | 192 } |
| 193 | 193 |
| 194 // Because GData WAPI support is expected to be gone somehow soon by migration | |
| 195 // to the Drive API v2, so we'll reuse GetResourceListOperation to implement | |
| 196 // following methods, instead of cleaning the operation class. | |
| 197 | |
| 194 void GDataWapiService::GetAllResourceList( | 198 void GDataWapiService::GetAllResourceList( |
| 195 const GetResourceListCallback& callback) { | 199 const GetResourceListCallback& callback) { |
| 196 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 200 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 197 DCHECK(!callback.is_null()); | 201 DCHECK(!callback.is_null()); |
| 198 | 202 |
| 199 // TODO(hidehiko): Implement this. | 203 runner_->StartOperationWithRetry( |
| 200 NOTIMPLEMENTED(); | 204 new GetResourceListOperation( |
| 205 operation_registry(), | |
| 206 url_request_context_getter_, | |
| 207 url_generator_, | |
| 208 GURL(), // No override url | |
| 209 0, // start changestamp | |
| 210 "", // empty search query | |
| 211 false, // shared_with_me | |
|
hashimoto
2013/04/04 09:24:45
nit: Please be consistent to use one of "shared_wi
hidehiko
2013/04/05 05:17:56
Acknowledged.
Fortunately (?), shared_with_me was
| |
| 212 "", // no directory resource id | |
| 213 callback)); | |
| 201 } | 214 } |
| 202 | 215 |
| 203 void GDataWapiService::GetResourceListInDirectory( | 216 void GDataWapiService::GetResourceListInDirectory( |
| 204 const std::string& directory_resource_id, | 217 const std::string& directory_resource_id, |
| 205 const GetResourceListCallback& callback) { | 218 const GetResourceListCallback& callback) { |
| 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 219 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 207 DCHECK(!directory_resource_id.empty()); | 220 DCHECK(!directory_resource_id.empty()); |
| 208 DCHECK(!callback.is_null()); | 221 DCHECK(!callback.is_null()); |
| 209 | 222 |
| 210 // TODO(hidehiko): Implement this. | 223 runner_->StartOperationWithRetry( |
| 211 NOTIMPLEMENTED(); | 224 new GetResourceListOperation( |
| 225 operation_registry(), | |
| 226 url_request_context_getter_, | |
| 227 url_generator_, | |
| 228 GURL(), // No override url | |
| 229 0, // start changestamp | |
| 230 "", // empty search query | |
| 231 false, // no shared with me | |
| 232 directory_resource_id, | |
| 233 callback)); | |
| 212 } | 234 } |
| 213 | 235 |
| 214 void GDataWapiService::Search(const std::string& search_query, | 236 void GDataWapiService::Search(const std::string& search_query, |
| 215 const GetResourceListCallback& callback) { | 237 const GetResourceListCallback& callback) { |
| 216 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 238 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 217 DCHECK(!search_query.empty()); | 239 DCHECK(!search_query.empty()); |
| 218 DCHECK(!callback.is_null()); | 240 DCHECK(!callback.is_null()); |
| 219 | 241 |
| 220 // TODO(hidehiko): Implement this. | 242 runner_->StartOperationWithRetry( |
| 221 NOTIMPLEMENTED(); | 243 new GetResourceListOperation( |
| 244 operation_registry(), | |
| 245 url_request_context_getter_, | |
| 246 url_generator_, | |
| 247 GURL(), // No override url | |
| 248 0, // start changestamp | |
| 249 search_query, | |
| 250 false, // no shared with me | |
| 251 "", // no directory resource id | |
| 252 callback)); | |
| 222 } | 253 } |
| 223 | 254 |
| 224 void GDataWapiService::SearchInDirectory( | 255 void GDataWapiService::SearchInDirectory( |
| 225 const std::string& search_query, | 256 const std::string& search_query, |
| 226 const std::string& directory_resource_id, | 257 const std::string& directory_resource_id, |
| 227 const GetResourceListCallback& callback) { | 258 const GetResourceListCallback& callback) { |
| 228 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 259 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 229 DCHECK(!search_query.empty()); | 260 DCHECK(!search_query.empty()); |
| 230 DCHECK(!directory_resource_id.empty()); | 261 DCHECK(!directory_resource_id.empty()); |
| 231 DCHECK(!callback.is_null()); | 262 DCHECK(!callback.is_null()); |
| 232 | 263 |
| 233 // TODO(hidehiko): Implement this. | 264 runner_->StartOperationWithRetry( |
| 234 NOTIMPLEMENTED(); | 265 new GetResourceListOperation( |
| 266 operation_registry(), | |
| 267 url_request_context_getter_, | |
| 268 url_generator_, | |
| 269 GURL(), // No override url | |
| 270 0, // start changestamp | |
| 271 search_query, | |
| 272 false, // no shared with me | |
| 273 directory_resource_id, | |
| 274 callback)); | |
| 235 } | 275 } |
| 236 | 276 |
| 237 void GDataWapiService::GetChangeList(int64 start_changestamp, | 277 void GDataWapiService::GetChangeList(int64 start_changestamp, |
| 238 const GetResourceListCallback& callback) { | 278 const GetResourceListCallback& callback) { |
| 239 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 279 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 240 DCHECK(!callback.is_null()); | 280 DCHECK(!callback.is_null()); |
| 241 | 281 |
| 242 // TODO(hidehiko): Implement this. | 282 runner_->StartOperationWithRetry( |
| 243 NOTIMPLEMENTED(); | 283 new GetResourceListOperation( |
| 284 operation_registry(), | |
| 285 url_request_context_getter_, | |
| 286 url_generator_, | |
| 287 GURL(), // No override url | |
| 288 start_changestamp, | |
| 289 "", // empty search query | |
| 290 false, // shared_with_me | |
| 291 "", // no directory resource id | |
| 292 callback)); | |
| 244 } | 293 } |
| 245 | 294 |
| 246 void GDataWapiService::ContinueGetResourceList( | 295 void GDataWapiService::ContinueGetResourceList( |
| 247 const GURL& override_url, | 296 const GURL& override_url, |
| 248 const GetResourceListCallback& callback) { | 297 const GetResourceListCallback& callback) { |
| 249 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 298 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 299 DCHECK(!override_url.is_empty()); | |
| 250 DCHECK(!callback.is_null()); | 300 DCHECK(!callback.is_null()); |
| 251 | 301 |
| 252 // TODO(hidehiko): Implement this. | 302 runner_->StartOperationWithRetry( |
| 253 NOTIMPLEMENTED(); | 303 new GetResourceListOperation( |
| 304 operation_registry(), | |
| 305 url_request_context_getter_, | |
| 306 url_generator_, | |
| 307 override_url, | |
| 308 0, // start changestamp | |
| 309 "", // empty search query | |
| 310 false, // shared_with_me | |
| 311 "", // no directory resource id | |
| 312 callback)); | |
| 254 } | 313 } |
| 255 | 314 |
| 256 void GDataWapiService::GetResourceEntry( | 315 void GDataWapiService::GetResourceEntry( |
| 257 const std::string& resource_id, | 316 const std::string& resource_id, |
| 258 const GetResourceEntryCallback& callback) { | 317 const GetResourceEntryCallback& callback) { |
| 259 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 318 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 260 DCHECK(!callback.is_null()); | 319 DCHECK(!callback.is_null()); |
| 261 | 320 |
| 262 runner_->StartOperationWithRetry( | 321 runner_->StartOperationWithRetry( |
| 263 new GetResourceEntryOperation( | 322 new GetResourceEntryOperation( |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 573 } | 632 } |
| 574 | 633 |
| 575 void GDataWapiService::OnProgressUpdate( | 634 void GDataWapiService::OnProgressUpdate( |
| 576 const OperationProgressStatusList& list) { | 635 const OperationProgressStatusList& list) { |
| 577 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 636 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 578 FOR_EACH_OBSERVER( | 637 FOR_EACH_OBSERVER( |
| 579 DriveServiceObserver, observers_, OnProgressUpdate(list)); | 638 DriveServiceObserver, observers_, OnProgressUpdate(list)); |
| 580 } | 639 } |
| 581 | 640 |
| 582 } // namespace google_apis | 641 } // namespace google_apis |
| OLD | NEW |