| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ | 5 #ifndef GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ |
| 6 #define GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ | 6 #define GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 14 | 14 |
| 15 namespace google_apis { | 15 namespace google_apis { |
| 16 | 16 |
| 17 // This class is used to generate URLs for communicating with drive api | 17 // This class is used to generate URLs for communicating with drive api |
| 18 // servers for production, and a local server for testing. | 18 // servers for production, and a local server for testing. |
| 19 class DriveApiUrlGenerator { | 19 class DriveApiUrlGenerator { |
| 20 public: | 20 public: |
| 21 // |base_url| is the path to the target drive api server. | 21 // |base_url| is the path to the target drive api server. |
| 22 // Note that this is an injecting point for a testing server. | 22 // Note that this is an injecting point for a testing server. |
| 23 DriveApiUrlGenerator(const GURL& base_url, | 23 DriveApiUrlGenerator(const GURL& base_url, |
| 24 const GURL& base_download_url, | |
| 25 const GURL& base_thumbnail_url); | 24 const GURL& base_thumbnail_url); |
| 26 ~DriveApiUrlGenerator(); | 25 ~DriveApiUrlGenerator(); |
| 27 | 26 |
| 28 // The base URL for communicating with the production drive api server. | 27 // The base URL for communicating with the production drive api server. |
| 29 static const char kBaseUrlForProduction[]; | 28 static const char kBaseUrlForProduction[]; |
| 30 | 29 |
| 31 // The base URL for the file download server for production. | |
| 32 static const char kBaseDownloadUrlForProduction[]; | |
| 33 | |
| 34 // The base URL for the thumbnail download server for production. | 30 // The base URL for the thumbnail download server for production. |
| 35 static const char kBaseThumbnailUrlForProduction[]; | 31 static const char kBaseThumbnailUrlForProduction[]; |
| 36 | 32 |
| 37 // Returns a URL to invoke "About: get" method. | 33 // Returns a URL to invoke "About: get" method. |
| 38 GURL GetAboutGetUrl() const; | 34 GURL GetAboutGetUrl() const; |
| 39 | 35 |
| 40 // Returns a URL to invoke "Apps: list" method. | 36 // Returns a URL to invoke "Apps: list" method. |
| 41 // Set |use_internal_endpoint| to true if official Chrome's API key is used | 37 // Set |use_internal_endpoint| to true if official Chrome's API key is used |
| 42 // and retrieving more information (related to App uninstall) is necessary. | 38 // and retrieving more information (related to App uninstall) is necessary. |
| 43 GURL GetAppsListUrl(bool use_internal_endpoint) const; | 39 GURL GetAppsListUrl(bool use_internal_endpoint) const; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 const GURL base_url_; | 126 const GURL base_url_; |
| 131 const GURL base_download_url_; | 127 const GURL base_download_url_; |
| 132 const GURL base_thumbnail_url_; | 128 const GURL base_thumbnail_url_; |
| 133 | 129 |
| 134 // This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here. | 130 // This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here. |
| 135 }; | 131 }; |
| 136 | 132 |
| 137 } // namespace google_apis | 133 } // namespace google_apis |
| 138 | 134 |
| 139 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ | 135 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ |
| OLD | NEW |