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 // This file provides base classes used to implement operations for Google APIs. | 5 // This file provides base classes used to implement operations for Google APIs. |
6 | 6 |
7 #ifndef CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ | 7 #ifndef CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ |
8 #define CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ | 8 #define CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "chrome/browser/google_apis/drive_upload_mode.h" | 15 #include "chrome/browser/google_apis/drive_upload_mode.h" |
16 #include "chrome/browser/google_apis/gdata_errorcode.h" | 16 #include "chrome/browser/google_apis/gdata_errorcode.h" |
17 #include "chrome/browser/google_apis/operation_registry.h" | 17 #include "chrome/browser/google_apis/operation_registry.h" |
18 #include "google_apis/gaia/oauth2_access_token_consumer.h" | |
19 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
20 #include "net/url_request/url_fetcher.h" | 19 #include "net/url_request/url_fetcher.h" |
21 #include "net/url_request/url_fetcher_delegate.h" | 20 #include "net/url_request/url_fetcher_delegate.h" |
22 | 21 |
23 class OAuth2AccessTokenFetcher; | |
24 | |
25 namespace base { | 22 namespace base { |
26 class Value; | 23 class Value; |
27 } // namespace base | 24 } // namespace base |
28 | 25 |
29 namespace net { | 26 namespace net { |
30 class URLRequestContextGetter; | 27 class URLRequestContextGetter; |
31 } // namespace net | 28 } // namespace net |
32 | 29 |
33 namespace google_apis { | 30 namespace google_apis { |
34 | 31 |
35 // Callback used to pass parsed JSON from ParseJson(). If parsing error occures, | 32 // Callback used to pass parsed JSON from ParseJson(). If parsing error occurs, |
36 // then the passed argument is null. | 33 // then the passed argument is null. |
37 typedef base::Callback<void(scoped_ptr<base::Value> value)> ParseJsonCallback; | 34 typedef base::Callback<void(scoped_ptr<base::Value> value)> ParseJsonCallback; |
38 | 35 |
39 // Parses JSON passed in |json| on blocking pool. Runs |callback| on the calling | 36 // Parses JSON passed in |json| on blocking pool. Runs |callback| on the calling |
40 // thread when finished with either success or failure. | 37 // thread when finished with either success or failure. |
41 // The callback must not be null. | 38 // The callback must not be null. |
42 void ParseJson(const std::string& json, const ParseJsonCallback& callback); | 39 void ParseJson(const std::string& json, const ParseJsonCallback& callback); |
43 | 40 |
44 //======================= AuthenticatedOperationInterface ====================== | 41 //======================= AuthenticatedOperationInterface ====================== |
45 | 42 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 const DownloadActionCallback download_action_callback_; | 398 const DownloadActionCallback download_action_callback_; |
402 const GetContentCallback get_content_callback_; | 399 const GetContentCallback get_content_callback_; |
403 const GURL download_url_; | 400 const GURL download_url_; |
404 | 401 |
405 DISALLOW_COPY_AND_ASSIGN(DownloadFileOperation); | 402 DISALLOW_COPY_AND_ASSIGN(DownloadFileOperation); |
406 }; | 403 }; |
407 | 404 |
408 } // namespace google_apis | 405 } // namespace google_apis |
409 | 406 |
410 #endif // CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ | 407 #endif // CHROME_BROWSER_GOOGLE_APIS_BASE_OPERATIONS_H_ |
OLD | NEW |