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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
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 GetDataCallback& callback) { | 106 const GetDataCallback& callback) { |
106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
107 | 108 |
108 GetDocumentsOperation* operation = | 109 GetDocumentsOperation* operation = |
109 new GetDocumentsOperation(operation_registry_.get(), | 110 new GetDocumentsOperation(operation_registry_.get(), |
110 profile_, | 111 profile_, |
111 start_changestamp, | 112 start_changestamp, |
| 113 search_query, |
112 callback); | 114 callback); |
113 if (!url.is_empty()) | 115 if (!url.is_empty()) |
114 operation->SetUrl(url); | 116 operation->SetUrl(url); |
115 StartOperationWithRetry(operation); | 117 StartOperationWithRetry(operation); |
116 } | 118 } |
117 | 119 |
118 void DocumentsService::GetAccountMetadata(const GetDataCallback& callback) { | 120 void DocumentsService::GetAccountMetadata(const GetDataCallback& callback) { |
119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 121 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
120 | 122 |
121 GetAccountMetadataOperation* operation = | 123 GetAccountMetadataOperation* operation = |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 void DocumentsService::RetryOperation(GDataOperationInterface* operation) { | 304 void DocumentsService::RetryOperation(GDataOperationInterface* operation) { |
303 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 305 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
304 | 306 |
305 gdata_auth_service_->ClearOAuth2Token(); | 307 gdata_auth_service_->ClearOAuth2Token(); |
306 // User authentication might have expired - rerun the request to force | 308 // User authentication might have expired - rerun the request to force |
307 // auth token refresh. | 309 // auth token refresh. |
308 StartOperation(operation); | 310 StartOperation(operation); |
309 } | 311 } |
310 | 312 |
311 } // namespace gdata | 313 } // namespace gdata |
OLD | NEW |