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

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

Issue 15908002: Differential updates for components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync to LKGR revision 207804. Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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/common/omaha_query_params/omaha_query_params.h" 5 #include "chrome/common/omaha_query_params/omaha_query_params.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 #include "chrome/common/chrome_version_info.h" 10 #include "chrome/common/chrome_version_info.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #elif defined(__mips__) 42 #elif defined(__mips__)
43 "mipsel"; 43 "mipsel";
44 #else 44 #else
45 #error "unknown arch" 45 #error "unknown arch"
46 #endif 46 #endif
47 47
48 const char kChrome[] = "chrome"; 48 const char kChrome[] = "chrome";
49 const char kChromeCrx[] = "chromecrx"; 49 const char kChromeCrx[] = "chromecrx";
50 const char kChromiumCrx[] = "chromiumcrx"; 50 const char kChromiumCrx[] = "chromiumcrx";
51 51
52 const char* GetProdIdString(chrome::OmahaQueryParams::ProdId prod) {
53 switch (prod) {
54 case chrome::OmahaQueryParams::CHROME:
55 return kChrome;
56 break;
57 case chrome::OmahaQueryParams::CRX:
58 #if defined(GOOGLE_CHROME_BUILD)
59 return kChromeCrx;
60 #else
61 return kChromiumCrx;
62 #endif
63 break;
64 }
65 return kUnknown;
66 }
67
68 const char kStable[] = "stable"; 52 const char kStable[] = "stable";
69 const char kBeta[] = "beta"; 53 const char kBeta[] = "beta";
70 const char kDev[] = "dev"; 54 const char kDev[] = "dev";
71 const char kCanary[] = "canary"; 55 const char kCanary[] = "canary";
72 56
73 const char* GetChannelString() { 57 const char* GetChannelString() {
74 switch (chrome::VersionInfo::GetChannel()) { 58 switch (chrome::VersionInfo::GetChannel()) {
75 case chrome::VersionInfo::CHANNEL_STABLE: 59 case chrome::VersionInfo::CHANNEL_STABLE:
76 return kStable; 60 return kStable;
77 break; 61 break;
(...skipping 10 matching lines...) Expand all
88 return kUnknown; 72 return kUnknown;
89 break; 73 break;
90 } 74 }
91 return kUnknown; 75 return kUnknown;
92 } 76 }
93 77
94 } // namespace 78 } // namespace
95 79
96 namespace chrome { 80 namespace chrome {
97 81
82 // static
98 std::string OmahaQueryParams::Get(ProdId prod) { 83 std::string OmahaQueryParams::Get(ProdId prod) {
99 return base::StringPrintf( 84 return base::StringPrintf(
100 "os=%s&arch=%s&nacl_arch=%s&prod=%s&prodchannel=%s&prodversion=%s", 85 "os=%s&arch=%s&nacl_arch=%s&prod=%s&prodchannel=%s&prodversion=%s",
101 kOs, 86 kOs,
102 kArch, 87 kArch,
103 getNaclArch(), 88 getNaclArch(),
104 GetProdIdString(prod), 89 GetProdIdString(prod),
105 GetChannelString(), 90 GetChannelString(),
106 chrome::VersionInfo().Version().c_str()); 91 chrome::VersionInfo().Version().c_str());
107 } 92 }
108 93
109 // static 94 // static
95 const char* OmahaQueryParams::GetProdIdString(
96 chrome::OmahaQueryParams::ProdId prod) {
97 switch (prod) {
98 case chrome::OmahaQueryParams::CHROME:
99 return kChrome;
100 break;
101 case chrome::OmahaQueryParams::CRX:
102 #if defined(GOOGLE_CHROME_BUILD)
103 return kChromeCrx;
104 #else
105 return kChromiumCrx;
106 #endif
107 break;
108 }
109 return kUnknown;
110 }
111
112 // static
110 const char* OmahaQueryParams::getOS() { 113 const char* OmahaQueryParams::getOS() {
111 return kOs; 114 return kOs;
112 } 115 }
113 116
114 // static 117 // static
115 const char* OmahaQueryParams::getArch() { 118 const char* OmahaQueryParams::getArch() {
116 return kArch; 119 return kArch;
117 } 120 }
118 121
119 // static 122 // static
(...skipping 13 matching lines...) Expand all
133 #elif defined(ARCH_CPU_MIPSEL) 136 #elif defined(ARCH_CPU_MIPSEL)
134 return "mips32"; 137 return "mips32";
135 #else 138 #else
136 // NOTE: when adding new values here, please remember to update the 139 // NOTE: when adding new values here, please remember to update the
137 // comment in the .h file about possible return values from this function. 140 // comment in the .h file about possible return values from this function.
138 #error "You need to add support for your architecture here" 141 #error "You need to add support for your architecture here"
139 #endif 142 #endif
140 } 143 }
141 144
142 } // namespace chrome 145 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/omaha_query_params/omaha_query_params.h ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698