| 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 "components/drive/service/drive_api_service.h" | 5 #include "components/drive/service/drive_api_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // per single request, which disables us to set the largest value (1000). | 93 // per single request, which disables us to set the largest value (1000). |
| 94 // TODO(kinaba): make it larger when the server gets faster. | 94 // TODO(kinaba): make it larger when the server gets faster. |
| 95 const int kMaxNumFilesResourcePerRequest = 300; | 95 const int kMaxNumFilesResourcePerRequest = 300; |
| 96 const int kMaxNumFilesResourcePerRequestForSearch = 100; | 96 const int kMaxNumFilesResourcePerRequestForSearch = 100; |
| 97 | 97 |
| 98 // For performance, we declare all fields we use. | 98 // For performance, we declare all fields we use. |
| 99 const char kAboutResourceFields[] = | 99 const char kAboutResourceFields[] = |
| 100 "kind,quotaBytesTotal,quotaBytesUsedAggregate,largestChangeId,rootFolderId"; | 100 "kind,quotaBytesTotal,quotaBytesUsedAggregate,largestChangeId,rootFolderId"; |
| 101 const char kFileResourceFields[] = | 101 const char kFileResourceFields[] = |
| 102 "kind,id,title,createdDate,sharedWithMeDate,mimeType," | 102 "kind,id,title,createdDate,sharedWithMeDate,mimeType," |
| 103 "md5Checksum,fileSize,labels/trashed,imageMediaMetadata/width," | 103 "md5Checksum,fileSize,labels/trashed,labels/starred," |
| 104 "imageMediaMetadata/width," |
| 104 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," | 105 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," |
| 105 "parents(id,parentLink),alternateLink," | 106 "parents(id,parentLink),alternateLink," |
| 106 "modifiedDate,lastViewedByMeDate,shared"; | 107 "modifiedDate,lastViewedByMeDate,shared"; |
| 107 const char kFileResourceOpenWithLinksFields[] = | 108 const char kFileResourceOpenWithLinksFields[] = |
| 108 "kind,id,openWithLinks/*"; | 109 "kind,id,openWithLinks/*"; |
| 109 const char kFileResourceShareLinkFields[] = | 110 const char kFileResourceShareLinkFields[] = |
| 110 "kind,id,shareLink"; | 111 "kind,id,shareLink"; |
| 111 const char kFileListFields[] = | 112 const char kFileListFields[] = |
| 112 "kind,items(kind,id,title,createdDate,sharedWithMeDate," | 113 "kind,items(kind,id,title,createdDate,sharedWithMeDate," |
| 113 "mimeType,md5Checksum,fileSize,labels/trashed,imageMediaMetadata/width," | 114 "mimeType,md5Checksum,fileSize,labels/trashed,labels/starred," |
| 115 "imageMediaMetadata/width," |
| 114 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," | 116 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," |
| 115 "parents(id,parentLink),alternateLink," | 117 "parents(id,parentLink),alternateLink," |
| 116 "modifiedDate,lastViewedByMeDate,shared),nextLink"; | 118 "modifiedDate,lastViewedByMeDate,shared),nextLink"; |
| 117 const char kChangeListFields[] = | 119 const char kChangeListFields[] = |
| 118 "kind,items(file(kind,id,title,createdDate,sharedWithMeDate," | 120 "kind,items(file(kind,id,title,createdDate,sharedWithMeDate," |
| 119 "mimeType,md5Checksum,fileSize,labels/trashed,imageMediaMetadata/width," | 121 "mimeType,md5Checksum,fileSize,labels/trashed,labels/starred," |
| 122 "imageMediaMetadata/width," |
| 120 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," | 123 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," |
| 121 "parents(id,parentLink),alternateLink,modifiedDate," | 124 "parents(id,parentLink),alternateLink,modifiedDate," |
| 122 "lastViewedByMeDate,shared),deleted,id,fileId,modificationDate),nextLink," | 125 "lastViewedByMeDate,shared),deleted,id,fileId,modificationDate),nextLink," |
| 123 "largestChangeId"; | 126 "largestChangeId"; |
| 124 | 127 |
| 125 void ExtractOpenUrlAndRun(const std::string& app_id, | 128 void ExtractOpenUrlAndRun(const std::string& app_id, |
| 126 const AuthorizeAppCallback& callback, | 129 const AuthorizeAppCallback& callback, |
| 127 DriveApiErrorCode error, | 130 DriveApiErrorCode error, |
| 128 std::unique_ptr<FileResource> value) { | 131 std::unique_ptr<FileResource> value) { |
| 129 DCHECK(!callback.is_null()); | 132 DCHECK(!callback.is_null()); |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 // reference to RequestSender and we should ensure to delete the request when | 870 // reference to RequestSender and we should ensure to delete the request when |
| 868 // the sender is deleted. Resolve the circulating dependency and fix it. | 871 // the sender is deleted. Resolve the circulating dependency and fix it. |
| 869 const google_apis::CancelCallback callback = | 872 const google_apis::CancelCallback callback = |
| 870 sender_->StartRequestWithAuthRetry(request.release()); | 873 sender_->StartRequestWithAuthRetry(request.release()); |
| 871 return base::WrapUnique<BatchRequestConfiguratorInterface>( | 874 return base::WrapUnique<BatchRequestConfiguratorInterface>( |
| 872 new BatchRequestConfigurator(weak_ref, sender_->blocking_task_runner(), | 875 new BatchRequestConfigurator(weak_ref, sender_->blocking_task_runner(), |
| 873 url_generator_, callback)); | 876 url_generator_, callback)); |
| 874 } | 877 } |
| 875 | 878 |
| 876 } // namespace drive | 879 } // namespace drive |
| OLD | NEW |