Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/services/gcm/gcm_desktop_utils.cc

Issue 657703002: Revert of [GCM] Start GCMChannelStatusSyncer when GCM is disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/gcm_driver/gcm_channel_status_request.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "chrome/browser/services/gcm/gcm_desktop_utils.h" 5 #include "chrome/browser/services/gcm/gcm_desktop_utils.h"
6 6
7 #include "base/command_line.h"
8 #include "base/logging.h" 7 #include "base/logging.h"
9 #include "base/sequenced_task_runner.h" 8 #include "base/sequenced_task_runner.h"
10 #include "base/threading/sequenced_worker_pool.h" 9 #include "base/threading/sequenced_worker_pool.h"
11 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" 10 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h"
12 #include "chrome/browser/sync/profile_sync_service.h" 11 #include "chrome/browser/sync/profile_sync_service.h"
13 #include "chrome/common/chrome_version_info.h" 12 #include "chrome/common/chrome_version_info.h"
14 #include "components/gcm_driver/gcm_client.h" 13 #include "components/gcm_driver/gcm_client.h"
15 #include "components/gcm_driver/gcm_client_factory.h" 14 #include "components/gcm_driver/gcm_client_factory.h"
16 #include "components/gcm_driver/gcm_driver.h" 15 #include "components/gcm_driver/gcm_driver.h"
17 #include "components/gcm_driver/gcm_driver_desktop.h" 16 #include "components/gcm_driver/gcm_driver_desktop.h"
18 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
19 18
20 namespace gcm { 19 namespace gcm {
21 20
22 namespace { 21 namespace {
23 22
24 const char kChannelStatusRelativePath[] = "/experimentstatus";
25
26 GCMClient::ChromePlatform GetPlatform() { 23 GCMClient::ChromePlatform GetPlatform() {
27 #if defined(OS_WIN) 24 #if defined(OS_WIN)
28 return GCMClient::PLATFORM_WIN; 25 return GCMClient::PLATFORM_WIN;
29 #elif defined(OS_MACOSX) 26 #elif defined(OS_MACOSX)
30 return GCMClient::PLATFORM_MAC; 27 return GCMClient::PLATFORM_MAC;
31 #elif defined(OS_IOS) 28 #elif defined(OS_IOS)
32 return GCMClient::PLATFORM_IOS; 29 return GCMClient::PLATFORM_IOS;
33 #elif defined(OS_ANDROID) 30 #elif defined(OS_ANDROID)
34 return GCMClient::PLATFORM_ANDROID; 31 return GCMClient::PLATFORM_ANDROID;
35 #elif defined(OS_CHROMEOS) 32 #elif defined(OS_CHROMEOS)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 65
69 GCMClient::ChromeBuildInfo GetChromeBuildInfo() { 66 GCMClient::ChromeBuildInfo GetChromeBuildInfo() {
70 GCMClient::ChromeBuildInfo chrome_build_info; 67 GCMClient::ChromeBuildInfo chrome_build_info;
71 chrome_build_info.platform = GetPlatform(); 68 chrome_build_info.platform = GetPlatform();
72 chrome_build_info.channel = GetChannel(); 69 chrome_build_info.channel = GetChannel();
73 chrome_build_info.version = GetVersion(); 70 chrome_build_info.version = GetVersion();
74 return chrome_build_info; 71 return chrome_build_info;
75 } 72 }
76 73
77 std::string GetChannelStatusRequestUrl() { 74 std::string GetChannelStatusRequestUrl() {
78 GURL sync_url( 75 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
79 ProfileSyncService::GetSyncServiceURL(*CommandLine::ForCurrentProcess())); 76 if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
80 return sync_url.spec() + kChannelStatusRelativePath; 77 channel == chrome::VersionInfo::CHANNEL_BETA) {
78 return ProfileSyncService::kSyncServerUrl;
79 }
80
81 return ProfileSyncService::kDevServerUrl;
81 } 82 }
82 83
83 std::string GetUserAgent() { 84 std::string GetUserAgent() {
84 chrome::VersionInfo version_info; 85 chrome::VersionInfo version_info;
85 return browser_sync::LocalDeviceInfoProviderImpl::MakeUserAgentForSyncApi( 86 return browser_sync::LocalDeviceInfoProviderImpl::MakeUserAgentForSyncApi(
86 version_info); 87 version_info);
87 } 88 }
88 89
89 } // namespace 90 } // namespace
90 91
(...skipping 17 matching lines...) Expand all
108 store_path, 109 store_path,
109 request_context, 110 request_context,
110 content::BrowserThread::GetMessageLoopProxyForThread( 111 content::BrowserThread::GetMessageLoopProxyForThread(
111 content::BrowserThread::UI), 112 content::BrowserThread::UI),
112 content::BrowserThread::GetMessageLoopProxyForThread( 113 content::BrowserThread::GetMessageLoopProxyForThread(
113 content::BrowserThread::IO), 114 content::BrowserThread::IO),
114 blocking_task_runner)); 115 blocking_task_runner));
115 } 116 }
116 117
117 } // namespace gcm 118 } // namespace gcm
OLDNEW
« no previous file with comments | « no previous file | components/gcm_driver/gcm_channel_status_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698