| 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_DRIVE_API_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_SERVICE_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_SERVICE_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "chrome/browser/google_apis/auth_service_observer.h" | 12 #include "chrome/browser/google_apis/auth_service_observer.h" |
| 13 #include "chrome/browser/google_apis/drive_api_url_generator.h" | 13 #include "chrome/browser/google_apis/drive_api_url_generator.h" |
| 14 #include "chrome/browser/google_apis/drive_service_interface.h" | 14 #include "chrome/browser/google_apis/drive_service_interface.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 class Profile; | 17 class Profile; |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class FilePath; | 20 class FilePath; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace net { | 23 namespace net { |
| 24 class URLRequestContextGetter; | 24 class URLRequestContextGetter; |
| 25 } // namespace net | 25 } // namespace net |
| 26 | 26 |
| 27 namespace google_apis { | 27 namespace google_apis { |
| 28 class OperationRunner; | 28 class RequestSender; |
| 29 | 29 |
| 30 // This class provides Drive operation calls using Drive V2 API. | 30 // This class provides Drive operation calls using Drive V2 API. |
| 31 // Details of API call are abstracted in each operation class and this class | 31 // Details of API call are abstracted in each operation class and this class |
| 32 // works as a thin wrapper for the API. | 32 // works as a thin wrapper for the API. |
| 33 class DriveAPIService : public DriveServiceInterface, | 33 class DriveAPIService : public DriveServiceInterface, |
| 34 public AuthServiceObserver { | 34 public AuthServiceObserver { |
| 35 public: | 35 public: |
| 36 // |url_request_context_getter| is used to initialize URLFetcher. | 36 // |url_request_context_getter| is used to initialize URLFetcher. |
| 37 // |base_url| is used to generate URLs for communication with the drive API. | 37 // |base_url| is used to generate URLs for communication with the drive API. |
| 38 // |custom_user_agent| will be used for the User-Agent header in HTTP | 38 // |custom_user_agent| will be used for the User-Agent header in HTTP |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 const std::string& resource_id, | 155 const std::string& resource_id, |
| 156 const std::string& app_id, | 156 const std::string& app_id, |
| 157 const AuthorizeAppCallback& callback) OVERRIDE; | 157 const AuthorizeAppCallback& callback) OVERRIDE; |
| 158 | 158 |
| 159 private: | 159 private: |
| 160 // AuthServiceObserver override. | 160 // AuthServiceObserver override. |
| 161 virtual void OnOAuth2RefreshTokenChanged() OVERRIDE; | 161 virtual void OnOAuth2RefreshTokenChanged() OVERRIDE; |
| 162 | 162 |
| 163 net::URLRequestContextGetter* url_request_context_getter_; | 163 net::URLRequestContextGetter* url_request_context_getter_; |
| 164 Profile* profile_; | 164 Profile* profile_; |
| 165 scoped_ptr<OperationRunner> runner_; | 165 scoped_ptr<RequestSender> sender_; |
| 166 ObserverList<DriveServiceObserver> observers_; | 166 ObserverList<DriveServiceObserver> observers_; |
| 167 DriveApiUrlGenerator url_generator_; | 167 DriveApiUrlGenerator url_generator_; |
| 168 const std::string custom_user_agent_; | 168 const std::string custom_user_agent_; |
| 169 | 169 |
| 170 DISALLOW_COPY_AND_ASSIGN(DriveAPIService); | 170 DISALLOW_COPY_AND_ASSIGN(DriveAPIService); |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 } // namespace google_apis | 173 } // namespace google_apis |
| 174 | 174 |
| 175 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_SERVICE_H_ | 175 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_SERVICE_H_ |
| OLD | NEW |