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 void DocumentsService::Authenticate(const AuthStatusCallback& callback) { | 96 void DocumentsService::Authenticate(const AuthStatusCallback& callback) { |
97 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 97 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
98 | 98 |
99 gdata_auth_service_->StartAuthentication(operation_registry_.get(), | 99 gdata_auth_service_->StartAuthentication(operation_registry_.get(), |
100 callback); | 100 callback); |
101 } | 101 } |
102 | 102 |
103 void DocumentsService::GetDocuments(const GURL& url, | 103 void DocumentsService::GetDocuments(const GURL& url, |
104 int start_changestamp, | 104 int start_changestamp, |
105 const std::string& search_query, | 105 const std::string& search_query, |
| 106 const std::string& directory_resource_id, |
106 const GetDataCallback& callback) { | 107 const GetDataCallback& callback) { |
107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 108 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
108 | 109 |
109 GetDocumentsOperation* operation = | 110 GetDocumentsOperation* operation = |
110 new GetDocumentsOperation(operation_registry_.get(), | 111 new GetDocumentsOperation(operation_registry_.get(), |
111 profile_, | 112 profile_, |
112 start_changestamp, | 113 start_changestamp, |
113 search_query, | 114 search_query, |
| 115 directory_resource_id, |
114 callback); | 116 callback); |
115 if (!url.is_empty()) | 117 if (!url.is_empty()) |
116 operation->SetUrl(url); | 118 operation->SetUrl(url); |
117 StartOperationWithRetry(operation); | 119 StartOperationWithRetry(operation); |
118 } | 120 } |
119 | 121 |
120 void DocumentsService::GetAccountMetadata(const GetDataCallback& callback) { | 122 void DocumentsService::GetAccountMetadata(const GetDataCallback& callback) { |
121 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 123 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
122 | 124 |
123 GetAccountMetadataOperation* operation = | 125 GetAccountMetadataOperation* operation = |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 void DocumentsService::RetryOperation(GDataOperationInterface* operation) { | 306 void DocumentsService::RetryOperation(GDataOperationInterface* operation) { |
305 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 307 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
306 | 308 |
307 gdata_auth_service_->ClearOAuth2Token(); | 309 gdata_auth_service_->ClearOAuth2Token(); |
308 // User authentication might have expired - rerun the request to force | 310 // User authentication might have expired - rerun the request to force |
309 // auth token refresh. | 311 // auth token refresh. |
310 StartOperation(operation); | 312 StartOperation(operation); |
311 } | 313 } |
312 | 314 |
313 } // namespace gdata | 315 } // namespace gdata |
OLD | NEW |