Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: chrome/browser/google_apis/drive_api_service.cc

Issue 14341002: Implement query translation from GData WAPI to Drive API v2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refine query parsing. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/google_apis/drive_api_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/string_util.h"
13 #include "base/stringprintf.h" 12 #include "base/stringprintf.h"
14 #include "base/task_runner_util.h" 13 #include "base/task_runner_util.h"
15 #include "base/threading/sequenced_worker_pool.h" 14 #include "base/threading/sequenced_worker_pool.h"
16 #include "base/values.h" 15 #include "base/values.h"
17 #include "chrome/browser/google_apis/auth_service.h" 16 #include "chrome/browser/google_apis/auth_service.h"
18 #include "chrome/browser/google_apis/drive_api_operations.h" 17 #include "chrome/browser/google_apis/drive_api_operations.h"
19 #include "chrome/browser/google_apis/drive_api_parser.h" 18 #include "chrome/browser/google_apis/drive_api_parser.h"
20 #include "chrome/browser/google_apis/drive_api_util.h" 19 #include "chrome/browser/google_apis/drive_api_util.h"
21 #include "chrome/browser/google_apis/gdata_wapi_operations.h" 20 #include "chrome/browser/google_apis/gdata_wapi_operations.h"
22 #include "chrome/browser/google_apis/gdata_wapi_parser.h" 21 #include "chrome/browser/google_apis/gdata_wapi_parser.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 const GetResourceListCallback& callback) { 328 const GetResourceListCallback& callback) {
330 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 329 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
331 DCHECK(!search_query.empty()); 330 DCHECK(!search_query.empty());
332 DCHECK(!callback.is_null()); 331 DCHECK(!callback.is_null());
333 332
334 runner_->StartOperationWithRetry( 333 runner_->StartOperationWithRetry(
335 new GetFilelistOperation( 334 new GetFilelistOperation(
336 operation_registry(), 335 operation_registry(),
337 url_request_context_getter_, 336 url_request_context_getter_,
338 url_generator_, 337 url_generator_,
339 search_query, 338 drive::util::TranslateQuery(search_query),
340 base::Bind(&ParseResourceListOnBlockingPoolAndRun, callback))); 339 base::Bind(&ParseResourceListOnBlockingPoolAndRun, callback)));
341 } 340 }
342 341
343 void DriveAPIService::SearchInDirectory( 342 void DriveAPIService::SearchInDirectory(
344 const std::string& search_query, 343 const std::string& search_query,
345 const std::string& directory_resource_id, 344 const std::string& directory_resource_id,
346 const GetResourceListCallback& callback) { 345 const GetResourceListCallback& callback) {
347 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 346 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
348 DCHECK(!search_query.empty()); 347 DCHECK(!search_query.empty());
349 DCHECK(!directory_resource_id.empty()); 348 DCHECK(!directory_resource_id.empty());
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 } 712 }
714 713
715 void DriveAPIService::OnProgressUpdate( 714 void DriveAPIService::OnProgressUpdate(
716 const OperationProgressStatusList& list) { 715 const OperationProgressStatusList& list) {
717 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 716 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
718 FOR_EACH_OBSERVER( 717 FOR_EACH_OBSERVER(
719 DriveServiceObserver, observers_, OnProgressUpdate(list)); 718 DriveServiceObserver, observers_, OnProgressUpdate(list));
720 } 719 }
721 720
722 } // namespace google_apis 721 } // namespace google_apis
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/google_apis/drive_api_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698