| 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 // URL utility functions for Google Documents List API (aka WAPI). | 5 // URL utility functions for Google Documents List API (aka WAPI). |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_URL_GENERATOR_H_ | 7 #ifndef CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_URL_GENERATOR_H_ |
| 8 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_URL_GENERATOR_H_ | 8 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_URL_GENERATOR_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 | 13 |
| 14 namespace google_apis { | 14 namespace google_apis { |
| 15 | 15 |
| 16 // The class is used to generate URLs for communicating with the WAPI server. | 16 // The class is used to generate URLs for communicating with the WAPI server. |
| 17 // for production, and the local server for testing. | 17 // for production, and the local server for testing. |
| 18 class GDataWapiUrlGenerator { | 18 class GDataWapiUrlGenerator { |
| 19 public: | 19 public: |
| 20 explicit GDataWapiUrlGenerator(const GURL& base_url); | 20 explicit GDataWapiUrlGenerator(const GURL& base_url); |
| 21 ~GDataWapiUrlGenerator(); | 21 ~GDataWapiUrlGenerator(); |
| 22 | 22 |
| 23 // The base URL for communicating with the WAPI server for production. | 23 // The base URL for communicating with the WAPI server for production. |
| 24 static const char kBaseUrlForProduction[]; | 24 static const char kBaseUrlForProduction[]; |
| 25 | 25 |
| 26 // Gets the base URL for communicating with the local test server for | |
| 27 // testing, running at the specified port number. | |
| 28 static GURL GetBaseUrlForTesting(int port); | |
| 29 | |
| 30 // Adds additional parameters for API version, output content type and to | 26 // Adds additional parameters for API version, output content type and to |
| 31 // show folders in the feed are added to document feed URLs. | 27 // show folders in the feed are added to document feed URLs. |
| 32 static GURL AddStandardUrlParams(const GURL& url); | 28 static GURL AddStandardUrlParams(const GURL& url); |
| 33 | 29 |
| 34 // Adds additional parameters to metadata feed to include installed 3rd | 30 // Adds additional parameters to metadata feed to include installed 3rd |
| 35 // party applications. | 31 // party applications. |
| 36 static GURL AddMetadataUrlParams(const GURL& url); | 32 static GURL AddMetadataUrlParams(const GURL& url); |
| 37 | 33 |
| 38 // Adds additional parameters for API version, output content type and to | 34 // Adds additional parameters for API version, output content type and to |
| 39 // show folders in the feed are added to document feed URLs. | 35 // show folders in the feed are added to document feed URLs. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Generates a URL for getting the account metadata feed. | 81 // Generates a URL for getting the account metadata feed. |
| 86 GURL GenerateAccountMetadataUrl() const; | 82 GURL GenerateAccountMetadataUrl() const; |
| 87 | 83 |
| 88 private: | 84 private: |
| 89 const GURL base_url_; | 85 const GURL base_url_; |
| 90 }; | 86 }; |
| 91 | 87 |
| 92 } // namespace google_apis | 88 } // namespace google_apis |
| 93 | 89 |
| 94 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_URL_GENERATOR_H_ | 90 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_URL_GENERATOR_H_ |
| OLD | NEW |