Chromium Code Reviews| Index: components/sync_driver/sync_util.cc |
| diff --git a/chrome/common/sync_util.cc b/components/sync_driver/sync_util.cc |
| similarity index 81% |
| rename from chrome/common/sync_util.cc |
| rename to components/sync_driver/sync_util.cc |
| index cd2f7e26ff76c7ec98b5bb3ba4db4ae33db26dba..2120d2b739910bba93331a0abf5db4b7ebddca33 100644 |
| --- a/chrome/common/sync_util.cc |
| +++ b/components/sync_driver/sync_util.cc |
| @@ -2,13 +2,12 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/common/sync_util.h" |
| +#include "components/sync_driver/sync_util.h" |
| #include "base/command_line.h" |
| #include "base/logging.h" |
| -#include "chrome/common/channel_info.h" |
| -#include "chrome/common/chrome_switches.h" |
| -#include "components/version_info/version_info.h" |
| +//#include "chrome/common/channel_info.h" |
|
droger
2015/08/25 11:25:43
Delete this line.
Jitu( very slow this week)
2015/08/25 11:39:57
Done.
|
| +#include "components/sync_driver/sync_driver_switches.h" |
| #include "url/gurl.h" |
| namespace { |
| @@ -39,14 +38,14 @@ const char* kSyncServerUrl = "https://clients4.google.com/chrome-sync"; |
| const char* kSyncDevServerUrl = "https://clients4.google.com/chrome-sync/dev"; |
| } // namespace internal |
| -GURL GetSyncServiceURL(const base::CommandLine& command_line) { |
| +GURL GetSyncServiceURL(const base::CommandLine& command_line, |
| + version_info::Channel channel) { |
| // By default, dev, canary, and unbranded Chromium users will go to the |
| // development servers. Development servers have more features than standard |
| // sync servers. Users with officially-branded Chrome stable and beta builds |
| // will go to the standard sync servers. |
| GURL result(internal::kSyncDevServerUrl); |
| - version_info::Channel channel = chrome::GetChannel(); |
| if (channel == version_info::Channel::STABLE || |
| channel == version_info::Channel::BETA) { |
| result = GURL(internal::kSyncServerUrl); |
| @@ -70,7 +69,7 @@ GURL GetSyncServiceURL(const base::CommandLine& command_line) { |
| return result; |
| } |
| -std::string MakeDesktopUserAgentForSync() { |
| +std::string MakeDesktopUserAgentForSync(version_info::Channel channel) { |
| std::string system = ""; |
| #if defined(OS_WIN) |
| system = "WIN "; |
| @@ -83,10 +82,11 @@ std::string MakeDesktopUserAgentForSync() { |
| #elif defined(OS_MACOSX) |
| system = "MAC "; |
| #endif |
| - return MakeUserAgentForSync(system); |
| + return MakeUserAgentForSync(system, channel); |
| } |
| -std::string MakeUserAgentForSync(const std::string& system) { |
| +std::string MakeUserAgentForSync(const std::string& system, |
| + version_info::Channel channel) { |
| std::string user_agent; |
| user_agent = "Chrome "; |
| user_agent += system; |
| @@ -95,7 +95,7 @@ std::string MakeUserAgentForSync(const std::string& system) { |
| if (!version_info::IsOfficialBuild()) { |
| user_agent += "-devel"; |
| } else { |
| - user_agent += " channel(" + ChannelToString(chrome::GetChannel()) + ")"; |
| + user_agent += " channel(" + ChannelToString(channel) + ")"; |
| } |
| return user_agent; |
| } |