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

Side by Side Diff: chrome/common/omaha_query_params.cc

Issue 12396002: Add chrome version information to extension update checks (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/common/omaha_query_params.h"
6
7 #include "base/stringprintf.h"
8 #include "chrome/common/chrome_version_info.h"
9
10 namespace {
11
12 const char kStable[] = "stable";
13 const char kBeta[] = "beta";
14 const char kDev[] = "dev";
15 const char kCanary[] = "canary";
16 const char kUnknown[] = "unknown";
17
18 const char* GetChannelString() {
19 switch (chrome::VersionInfo::GetChannel()) {
20 case chrome::VersionInfo::CHANNEL_STABLE:
21 return kStable;
22 break;
23 case chrome::VersionInfo::CHANNEL_BETA:
24 return kBeta;
25 break;
26 case chrome::VersionInfo::CHANNEL_DEV:
27 return kDev;
28 break;
29 case chrome::VersionInfo::CHANNEL_CANARY:
30 return kCanary;
31 break;
32 default:
33 return kUnknown;
34 }
35 }
36
37 // The request extra information is the OS and architecture, this helps
38 // the server select the right package to be delivered.
39 const char kOs[] =
40 #if defined(OS_MACOSX)
41 "mac";
42 #elif defined(OS_WIN)
43 "win";
44 #elif defined(OS_ANDROID)
45 "android";
46 #elif defined(OS_CHROMEOS)
47 "cros";
48 #elif defined(OS_LINUX)
49 "linux";
50 #elif defined(OS_OPENBSD)
51 "openbsd";
52 #else
53 #error "unknown os"
54 #endif
55
56 const char kArch[] =
57 #if defined(__amd64__) || defined(_WIN64)
58 "x64";
59 #elif defined(__i386__) || defined(_WIN32)
60 "x86";
61 #elif defined(__arm__)
62 "arm";
63 #else
64 "unknown";
asargent_no_longer_on_chrome 2013/03/06 00:45:06 Maybe we should do #error for this case too, simil
jackhou 2013/03/06 03:56:36 Done.
petarj 2013/04/18 16:05:05 MIPS architecture ain't wacky, is it? This part br
65 #endif
66
67 } // namespace
68
69 namespace chrome {
70
71 std::string GetOmahaQueryParams(const std::string& prod) {
72 return StringPrintf("os=%s&arch=%s&prod=%s&prodchannel=%s&prodversion=%s",
73 kOs,
74 kArch,
75 prod.c_str(),
76 GetChannelString(),
77 chrome::VersionInfo().Version().c_str());
78 }
79
80 } // namespace chrome
OLDNEW
« chrome/common/omaha_query_params.h ('K') | « chrome/common/omaha_query_params.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698