| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_SYNC_DRIVER_SYNC_UTIL_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_UTIL_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_SYNC_UTIL_H_ | 6 #define COMPONENTS_SYNC_DRIVER_SYNC_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "components/version_info/version_info.h" | 10 #include "components/version_info/version_info.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class CommandLine; | 15 class CommandLine; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace syncer { | |
| 19 namespace internal { | 18 namespace internal { |
| 20 | 19 |
| 21 // Default sync server URL. Visible for testing. | 20 // Default sync server URL. Visible for testing. |
| 22 extern const char* kSyncServerUrl; | 21 extern const char* kSyncServerUrl; |
| 23 | 22 |
| 24 // Sync server URL for dev channel users. Visible for testing. | 23 // Sync server URL for dev channel users. Visible for testing. |
| 25 extern const char* kSyncDevServerUrl; | 24 extern const char* kSyncDevServerUrl; |
| 26 | 25 |
| 27 // Formats user agent string from system string and channel. Visible for | 26 // Formats user agent string from system string and channel. Visible for |
| 28 // testing. | 27 // testing. |
| 29 std::string FormatUserAgentForSync(const std::string& system, | 28 std::string FormatUserAgentForSync(const std::string& system, |
| 30 version_info::Channel channel); | 29 version_info::Channel channel); |
| 31 | 30 |
| 32 } // namespace internal | 31 } // namespace internal |
| 33 | 32 |
| 34 GURL GetSyncServiceURL(const base::CommandLine& command_line, | 33 GURL GetSyncServiceURL(const base::CommandLine& command_line, |
| 35 version_info::Channel channel); | 34 version_info::Channel channel); |
| 36 | 35 |
| 37 // Helper to construct a user agent string (ASCII) suitable for use by | 36 // Helper to construct a user agent string (ASCII) suitable for use by |
| 38 // the syncapi for any HTTP communication. This string is used by the sync | 37 // the syncapi for any HTTP communication. This string is used by the sync |
| 39 // backend for classifying client types when calculating statistics. | 38 // backend for classifying client types when calculating statistics. |
| 40 std::string MakeUserAgentForSync(version_info::Channel channel, bool is_tablet); | 39 std::string MakeUserAgentForSync(version_info::Channel channel, bool is_tablet); |
| 41 | 40 |
| 42 } // namespace syncer | |
| 43 | |
| 44 #endif // COMPONENTS_SYNC_DRIVER_SYNC_UTIL_H_ | 41 #endif // COMPONENTS_SYNC_DRIVER_SYNC_UTIL_H_ |
| OLD | NEW |