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_DRIVE_GDATA_WAPI_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_DRIVE_GDATA_WAPI_SERVICE_H_ |
6 #define CHROME_BROWSER_DRIVE_GDATA_WAPI_SERVICE_H_ | 6 #define CHROME_BROWSER_DRIVE_GDATA_WAPI_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "chrome/browser/drive/drive_service_interface.h" | 14 #include "chrome/browser/drive/drive_service_interface.h" |
15 #include "chrome/browser/google_apis/auth_service_interface.h" | 15 #include "chrome/browser/google_apis/auth_service_interface.h" |
16 #include "chrome/browser/google_apis/auth_service_observer.h" | 16 #include "chrome/browser/google_apis/auth_service_observer.h" |
17 #include "chrome/browser/google_apis/gdata_wapi_requests.h" | 17 #include "chrome/browser/google_apis/gdata_wapi_requests.h" |
18 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" | 18 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" |
19 | 19 |
20 class GURL; | 20 class GURL; |
21 class OAuth2TokenService; | 21 class OAuth2TokenService; |
22 | 22 |
23 namespace base { | 23 namespace base { |
24 class FilePath; | 24 class FilePath; |
25 class TaskRunner; | 25 class TaskRunner; |
26 } | 26 } |
27 | 27 |
28 namespace google_apis { | 28 namespace google_apis { |
29 class FileResource; | |
29 class RequestSender; | 30 class RequestSender; |
30 } | 31 } |
31 | 32 |
32 namespace net { | 33 namespace net { |
33 class URLRequestContextGetter; | 34 class URLRequestContextGetter; |
34 } // namespace net | 35 } // namespace net |
35 | 36 |
36 namespace drive { | 37 namespace drive { |
37 | 38 |
38 // This class provides documents feed service calls for WAPI (codename for | 39 // This class provides documents feed service calls for WAPI (codename for |
(...skipping 11 matching lines...) Expand all Loading... | |
50 // |custom_user_agent| is used for the User-Agent header in HTTP | 51 // |custom_user_agent| is used for the User-Agent header in HTTP |
51 // requests issued through the service if the value is not empty. | 52 // requests issued through the service if the value is not empty. |
52 GDataWapiService(OAuth2TokenService* oauth2_token_service, | 53 GDataWapiService(OAuth2TokenService* oauth2_token_service, |
53 net::URLRequestContextGetter* url_request_context_getter, | 54 net::URLRequestContextGetter* url_request_context_getter, |
54 base::TaskRunner* blocking_task_runner, | 55 base::TaskRunner* blocking_task_runner, |
55 const GURL& base_url, | 56 const GURL& base_url, |
56 const GURL& base_download_url, | 57 const GURL& base_download_url, |
57 const std::string& custom_user_agent); | 58 const std::string& custom_user_agent); |
58 virtual ~GDataWapiService(); | 59 virtual ~GDataWapiService(); |
59 | 60 |
61 static scoped_ptr<google_apis::FileResource> | |
62 ConvertResourceEntryToFileResource(const google_apis::ResourceEntry& entry); | |
hidehiko
2013/09/09 03:52:00
Pls add comments for this function.
How about mov
tzik
2013/09/09 06:22:58
Done.
| |
63 | |
60 // DriveServiceInterface Overrides | 64 // DriveServiceInterface Overrides |
61 virtual void Initialize() OVERRIDE; | 65 virtual void Initialize() OVERRIDE; |
62 virtual void AddObserver(DriveServiceObserver* observer) OVERRIDE; | 66 virtual void AddObserver(DriveServiceObserver* observer) OVERRIDE; |
63 virtual void RemoveObserver(DriveServiceObserver* observer) OVERRIDE; | 67 virtual void RemoveObserver(DriveServiceObserver* observer) OVERRIDE; |
64 virtual bool CanSendRequest() const OVERRIDE; | 68 virtual bool CanSendRequest() const OVERRIDE; |
65 virtual std::string CanonicalizeResourceId( | 69 virtual std::string CanonicalizeResourceId( |
66 const std::string& resource_id) const OVERRIDE; | 70 const std::string& resource_id) const OVERRIDE; |
67 virtual bool HasAccessToken() const OVERRIDE; | 71 virtual bool HasAccessToken() const OVERRIDE; |
68 virtual void RequestAccessToken( | 72 virtual void RequestAccessToken( |
69 const google_apis::AuthStatusCallback& callback) OVERRIDE; | 73 const google_apis::AuthStatusCallback& callback) OVERRIDE; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 // reference, as they may outlive this object. | 201 // reference, as they may outlive this object. |
198 const google_apis::GDataWapiUrlGenerator url_generator_; | 202 const google_apis::GDataWapiUrlGenerator url_generator_; |
199 const std::string custom_user_agent_; | 203 const std::string custom_user_agent_; |
200 | 204 |
201 DISALLOW_COPY_AND_ASSIGN(GDataWapiService); | 205 DISALLOW_COPY_AND_ASSIGN(GDataWapiService); |
202 }; | 206 }; |
203 | 207 |
204 } // namespace drive | 208 } // namespace drive |
205 | 209 |
206 #endif // CHROME_BROWSER_DRIVE_GDATA_WAPI_SERVICE_H_ | 210 #endif // CHROME_BROWSER_DRIVE_GDATA_WAPI_SERVICE_H_ |
OLD | NEW |