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/chromeos/gdata/gdata_documents_service.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_documents_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 void DocumentsService::GetDocuments(const GURL& url, | 97 void DocumentsService::GetDocuments(const GURL& url, |
98 int start_changestamp, | 98 int start_changestamp, |
99 const std::string& search_query, | 99 const std::string& search_query, |
100 const std::string& directory_resource_id, | 100 const std::string& directory_resource_id, |
101 const GetDataCallback& callback) { | 101 const GetDataCallback& callback) { |
102 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 102 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
103 | 103 |
104 GetDocumentsOperation* operation = | 104 GetDocumentsOperation* operation = |
105 new GetDocumentsOperation(operation_registry(), | 105 new GetDocumentsOperation(operation_registry(), |
| 106 url, |
106 start_changestamp, | 107 start_changestamp, |
107 search_query, | 108 search_query, |
108 directory_resource_id, | 109 directory_resource_id, |
109 callback); | 110 callback); |
110 if (!url.is_empty()) | |
111 operation->SetUrl(url); | |
112 runner_->StartOperationWithRetry(operation); | 111 runner_->StartOperationWithRetry(operation); |
113 } | 112 } |
114 | 113 |
| 114 void DocumentsService::GetChangelist(const GURL& url, |
| 115 int64 start_changestamp, |
| 116 const GetDataCallback& callback) { |
| 117 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 118 |
| 119 GetChangelistOperation* operation = |
| 120 new GetChangelistOperation(operation_registry(), |
| 121 url, |
| 122 start_changestamp, |
| 123 callback); |
| 124 runner_->StartOperationWithRetry(operation); |
| 125 } |
| 126 |
115 void DocumentsService::GetDocumentEntry(const std::string& resource_id, | 127 void DocumentsService::GetDocumentEntry(const std::string& resource_id, |
116 const GetDataCallback& callback) { | 128 const GetDataCallback& callback) { |
117 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 129 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
118 | 130 |
119 GetDocumentEntryOperation* operation = | 131 GetDocumentEntryOperation* operation = |
120 new GetDocumentEntryOperation(operation_registry(), | 132 new GetDocumentEntryOperation(operation_registry(), |
121 resource_id, | 133 resource_id, |
122 callback); | 134 callback); |
123 runner_->StartOperationWithRetry(operation); | 135 runner_->StartOperationWithRetry(operation); |
124 } | 136 } |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 return runner_->auth_service()->HasAccessToken(); | 299 return runner_->auth_service()->HasAccessToken(); |
288 } | 300 } |
289 | 301 |
290 bool DocumentsService::HasRefreshToken() const { | 302 bool DocumentsService::HasRefreshToken() const { |
291 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 303 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
292 | 304 |
293 return runner_->auth_service()->HasRefreshToken(); | 305 return runner_->auth_service()->HasRefreshToken(); |
294 } | 306 } |
295 | 307 |
296 } // namespace gdata | 308 } // namespace gdata |
OLD | NEW |