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 #ifndef CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ |
6 #define CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 //============================ EntryActionOperation ============================ | 185 //============================ EntryActionOperation ============================ |
186 | 186 |
187 // Callback type for Delete/Move DocumentServiceInterface calls. | 187 // Callback type for Delete/Move DocumentServiceInterface calls. |
188 typedef base::Callback<void(GDataErrorCode error)> EntryActionCallback; | 188 typedef base::Callback<void(GDataErrorCode error)> EntryActionCallback; |
189 | 189 |
190 // This class performs a simple action over a given entry (document/file). | 190 // This class performs a simple action over a given entry (document/file). |
191 // It is meant to be used for operations that return no JSON blobs. | 191 // It is meant to be used for operations that return no JSON blobs. |
192 class EntryActionOperation : public UrlFetchOperationBase { | 192 class EntryActionOperation : public UrlFetchOperationBase { |
193 public: | 193 public: |
194 EntryActionOperation(OperationRegistry* registry, | 194 EntryActionOperation(OperationRegistry* registry, |
195 const EntryActionCallback& callback, | 195 const EntryActionCallback& callback); |
196 const GURL& document_url); | |
197 virtual ~EntryActionOperation(); | 196 virtual ~EntryActionOperation(); |
198 | 197 |
199 protected: | 198 protected: |
200 // Overridden from UrlFetchOperationBase. | 199 // Overridden from UrlFetchOperationBase. |
201 virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; | 200 virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; |
202 virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE; | 201 virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE; |
203 | 202 |
204 const GURL& document_url() const { return document_url_; } | |
205 | |
206 private: | 203 private: |
207 EntryActionCallback callback_; | 204 EntryActionCallback callback_; |
208 GURL document_url_; | |
209 | 205 |
210 DISALLOW_COPY_AND_ASSIGN(EntryActionOperation); | 206 DISALLOW_COPY_AND_ASSIGN(EntryActionOperation); |
211 }; | 207 }; |
212 | 208 |
213 //============================== GetDataOperation ============================== | 209 //============================== GetDataOperation ============================== |
214 | 210 |
215 // Callback type for DocumentServiceInterface::GetDocuments. | 211 // Callback type for DocumentServiceInterface::GetDocuments. |
216 // Note: feed_data argument should be passed using base::Passed(&feed_data), not | 212 // Note: feed_data argument should be passed using base::Passed(&feed_data), not |
217 // feed_data.Pass(). | 213 // feed_data.Pass(). |
218 typedef base::Callback<void(GDataErrorCode error, | 214 typedef base::Callback<void(GDataErrorCode error, |
(...skipping 27 matching lines...) Expand all Loading... |
246 | 242 |
247 // Note: This should remain the last member so it'll be destroyed and | 243 // Note: This should remain the last member so it'll be destroyed and |
248 // invalidate its weak pointers before any other members are destroyed. | 244 // invalidate its weak pointers before any other members are destroyed. |
249 base::WeakPtrFactory<GetDataOperation> weak_ptr_factory_; | 245 base::WeakPtrFactory<GetDataOperation> weak_ptr_factory_; |
250 DISALLOW_COPY_AND_ASSIGN(GetDataOperation); | 246 DISALLOW_COPY_AND_ASSIGN(GetDataOperation); |
251 }; | 247 }; |
252 | 248 |
253 } // namespace google_apis | 249 } // namespace google_apis |
254 | 250 |
255 #endif // CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ | 251 #endif // CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ |
OLD | NEW |