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_CHROMEOS_DRIVE_DRIVE_API_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_API_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_API_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_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" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // Details of API call are abstracted in each operation class and this class | 32 // Details of API call are abstracted in each operation class and this class |
33 // works as a thin wrapper for the API. | 33 // works as a thin wrapper for the API. |
34 class DriveAPIService : public google_apis::DriveServiceInterface, | 34 class DriveAPIService : public google_apis::DriveServiceInterface, |
35 public google_apis::AuthServiceObserver, | 35 public google_apis::AuthServiceObserver, |
36 public google_apis::OperationRegistryObserver { | 36 public google_apis::OperationRegistryObserver { |
37 public: | 37 public: |
38 // Instance is usually created by DriveSystemServiceFactory and owned by | 38 // Instance is usually created by DriveSystemServiceFactory and owned by |
39 // DriveFileSystem. | 39 // DriveFileSystem. |
40 // | 40 // |
41 // |url_request_context_getter| is used to initialize URLFetcher. | 41 // |url_request_context_getter| is used to initialize URLFetcher. |
| 42 // |base_url| is used to generate URLs for communication with the drive API. |
42 // |custom_user_agent| will be used for the User-Agent header in HTTP | 43 // |custom_user_agent| will be used for the User-Agent header in HTTP |
43 // requests issues through the service if the value is not empty. | 44 // requests issues through the service if the value is not empty. |
44 DriveAPIService( | 45 DriveAPIService( |
45 net::URLRequestContextGetter* url_request_context_getter, | 46 net::URLRequestContextGetter* url_request_context_getter, |
| 47 const GURL& base_url, |
46 const std::string& custom_user_agent); | 48 const std::string& custom_user_agent); |
47 virtual ~DriveAPIService(); | 49 virtual ~DriveAPIService(); |
48 | 50 |
49 // DriveServiceInterface Overrides | 51 // DriveServiceInterface Overrides |
50 virtual void Initialize(Profile* profile) OVERRIDE; | 52 virtual void Initialize(Profile* profile) OVERRIDE; |
51 virtual void AddObserver( | 53 virtual void AddObserver( |
52 google_apis::DriveServiceObserver* observer) OVERRIDE; | 54 google_apis::DriveServiceObserver* observer) OVERRIDE; |
53 virtual void RemoveObserver( | 55 virtual void RemoveObserver( |
54 google_apis::DriveServiceObserver* observer) OVERRIDE; | 56 google_apis::DriveServiceObserver* observer) OVERRIDE; |
55 virtual bool CanStartOperation() const OVERRIDE; | 57 virtual bool CanStartOperation() const OVERRIDE; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 ObserverList<google_apis::DriveServiceObserver> observers_; | 159 ObserverList<google_apis::DriveServiceObserver> observers_; |
158 google_apis::DriveApiUrlGenerator url_generator_; | 160 google_apis::DriveApiUrlGenerator url_generator_; |
159 const std::string custom_user_agent_; | 161 const std::string custom_user_agent_; |
160 | 162 |
161 DISALLOW_COPY_AND_ASSIGN(DriveAPIService); | 163 DISALLOW_COPY_AND_ASSIGN(DriveAPIService); |
162 }; | 164 }; |
163 | 165 |
164 } // namespace drive | 166 } // namespace drive |
165 | 167 |
166 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_API_SERVICE_H_ | 168 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_API_SERVICE_H_ |
OLD | NEW |