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/drive_api_service.h" | 5 #include "chrome/browser/google_apis/drive_api_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" |
11 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
12 #include "base/string16.h" | |
12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
13 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
14 #include "base/task_runner_util.h" | 15 #include "base/task_runner_util.h" |
15 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
17 #include "base/utf_string_conversions.h" | |
hashimoto
2013/04/18 10:37:16
nit: No need to include this?
hidehiko
2013/04/18 12:05:54
Done.
| |
16 #include "base/values.h" | 18 #include "base/values.h" |
17 #include "chrome/browser/google_apis/auth_service.h" | 19 #include "chrome/browser/google_apis/auth_service.h" |
18 #include "chrome/browser/google_apis/drive_api_operations.h" | 20 #include "chrome/browser/google_apis/drive_api_operations.h" |
19 #include "chrome/browser/google_apis/drive_api_parser.h" | 21 #include "chrome/browser/google_apis/drive_api_parser.h" |
20 #include "chrome/browser/google_apis/drive_api_util.h" | 22 #include "chrome/browser/google_apis/drive_api_util.h" |
21 #include "chrome/browser/google_apis/gdata_wapi_operations.h" | 23 #include "chrome/browser/google_apis/gdata_wapi_operations.h" |
22 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 24 #include "chrome/browser/google_apis/gdata_wapi_parser.h" |
23 #include "chrome/browser/google_apis/operation_runner.h" | 25 #include "chrome/browser/google_apis/operation_runner.h" |
24 #include "chrome/browser/google_apis/time_util.h" | 26 #include "chrome/browser/google_apis/time_util.h" |
25 #include "chrome/browser/profiles/profile.h" | 27 #include "chrome/browser/profiles/profile.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 const GetResourceListCallback& callback) { | 331 const GetResourceListCallback& callback) { |
330 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 332 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
331 DCHECK(!search_query.empty()); | 333 DCHECK(!search_query.empty()); |
332 DCHECK(!callback.is_null()); | 334 DCHECK(!callback.is_null()); |
333 | 335 |
334 runner_->StartOperationWithRetry( | 336 runner_->StartOperationWithRetry( |
335 new GetFilelistOperation( | 337 new GetFilelistOperation( |
336 operation_registry(), | 338 operation_registry(), |
337 url_request_context_getter_, | 339 url_request_context_getter_, |
338 url_generator_, | 340 url_generator_, |
339 search_query, | 341 drive::util::TranslateQuery(search_query), |
340 base::Bind(&ParseResourceListOnBlockingPoolAndRun, callback))); | 342 base::Bind(&ParseResourceListOnBlockingPoolAndRun, callback))); |
341 } | 343 } |
342 | 344 |
343 void DriveAPIService::SearchInDirectory( | 345 void DriveAPIService::SearchInDirectory( |
344 const std::string& search_query, | 346 const std::string& search_query, |
345 const std::string& directory_resource_id, | 347 const std::string& directory_resource_id, |
346 const GetResourceListCallback& callback) { | 348 const GetResourceListCallback& callback) { |
347 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 349 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
348 DCHECK(!search_query.empty()); | 350 DCHECK(!search_query.empty()); |
349 DCHECK(!directory_resource_id.empty()); | 351 DCHECK(!directory_resource_id.empty()); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
713 } | 715 } |
714 | 716 |
715 void DriveAPIService::OnProgressUpdate( | 717 void DriveAPIService::OnProgressUpdate( |
716 const OperationProgressStatusList& list) { | 718 const OperationProgressStatusList& list) { |
717 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 719 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
718 FOR_EACH_OBSERVER( | 720 FOR_EACH_OBSERVER( |
719 DriveServiceObserver, observers_, OnProgressUpdate(list)); | 721 DriveServiceObserver, observers_, OnProgressUpdate(list)); |
720 } | 722 } |
721 | 723 |
722 } // namespace google_apis | 724 } // namespace google_apis |
OLD | NEW |