OLD | NEW |
---|---|
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 "components/update_client/update_query_params.h" | 5 #include "components/update_client/update_query_params.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
11 #include "components/update_client/update_query_params_delegate.h" | 11 #include "components/update_client/update_query_params_delegate.h" |
12 | 12 |
13 namespace update_client { | 13 namespace update_client { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 const char kUnknown[] = "unknown"; | 17 const char kUnknown[] = "unknown"; |
18 const char kStable[] = "stable"; | |
19 const char kBeta[] = "beta"; | |
20 const char kDev[] = "dev"; | |
21 const char kCanary[] = "canary"; | |
18 | 22 |
19 // The request extra information is the OS and architecture, this helps | 23 // The request extra information is the OS and architecture, this helps |
20 // the server select the right package to be delivered. | 24 // the server select the right package to be delivered. |
21 const char kOs[] = | 25 const char kOs[] = |
22 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
23 "mac"; | 27 "mac"; |
24 #elif defined(OS_WIN) | 28 #elif defined(OS_WIN) |
25 "win"; | 29 "win"; |
26 #elif defined(OS_ANDROID) | 30 #elif defined(OS_ANDROID) |
27 "android"; | 31 "android"; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 #error "You need to add support for your architecture here" | 125 #error "You need to add support for your architecture here" |
122 #endif | 126 #endif |
123 } | 127 } |
124 | 128 |
125 // static | 129 // static |
126 void UpdateQueryParams::SetDelegate(UpdateQueryParamsDelegate* delegate) { | 130 void UpdateQueryParams::SetDelegate(UpdateQueryParamsDelegate* delegate) { |
127 DCHECK(!g_delegate || !delegate || (delegate == g_delegate)); | 131 DCHECK(!g_delegate || !delegate || (delegate == g_delegate)); |
128 g_delegate = delegate; | 132 g_delegate = delegate; |
129 } | 133 } |
130 | 134 |
135 // static | |
136 const char* UpdateQueryParams::GetChannelString(version_info::Channel channel) { | |
sdefresne
2015/08/13 12:20:00
This is duplicating version_info::GetChannelString
droger
2015/08/13 13:17:46
Done, using version_info instead, which actually s
Sorin Jianu
2015/08/13 18:24:11
It appears that sdefresne@ componentized version_i
| |
137 switch (channel) { | |
138 case version_info::Channel::STABLE: | |
139 return kStable; | |
140 break; | |
141 case version_info::Channel::BETA: | |
142 return kBeta; | |
143 break; | |
144 case version_info::Channel::DEV: | |
145 return kDev; | |
146 break; | |
147 case version_info::Channel::CANARY: | |
148 return kCanary; | |
149 break; | |
150 case version_info::Channel::UNKNOWN: | |
151 return kUnknown; | |
152 break; | |
153 } | |
154 return kUnknown; | |
155 } | |
156 | |
131 } // namespace update_client | 157 } // namespace update_client |
OLD | NEW |